Skip to content

Commit

Permalink
Merge pull request #796 from vkarak/check/kernel-latency-generic
Browse files Browse the repository at this point in the history
[test] Make CUDA kernel latency tests generic
  • Loading branch information
Vasileios Karakasis committed May 23, 2019
2 parents a9715c0 + 3eac79f commit 08dd452
Showing 1 changed file with 24 additions and 8 deletions.
32 changes: 24 additions & 8 deletions cscs-checks/microbenchmarks/kernel_latency/kernel_latency.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,35 @@
class KernelLatencyTest(rfm.RegressionTest):
def __init__(self, kernel_version):
super().__init__()
self.sourcepath = 'kernel_latency.cu'
self.build_system = 'SingleSource'
# List known partitions here so as to avoid specifying them every time
# with --system
self.valid_systems = ['daint:gpu', 'dom:gpu', 'kesch:cn']
self.valid_prog_environs = ['PrgEnv-cray', 'PrgEnv-pgi']
self.num_tasks = 0
self.num_tasks_per_node = 1

self.sourcepath = 'kernel_latency.cu'
self.build_system = 'SingleSource'
self.build_system.cxxflags = ['-std=c++11']
if self.current_system.name in {'dom', 'daint'}:
self.num_gpus_per_node = 1
gpu_arch = '60'
self.modules = ['craype-accel-nvidia60']
self.valid_prog_environs += ['PrgEnv-gnu']
else:
self.valid_prog_environs = ['PrgEnv-cray', 'PrgEnv-pgi',
'PrgEnv-gnu']
elif self.current_system.name == 'kesch':
self.num_gpus_per_node = 16
self.valid_prog_environs = ['PrgEnv-cray', 'PrgEnv-pgi']
self.modules = ['craype-accel-nvidia35']
gpu_arch = '37'
else:
# Enable test when running on an unknown system
self.num_gpus_per_node = 1
self.valid_systems = ['*']
self.valid_prog_environs = ['*']
gpu_arch = None

self.build_system.cxxflags = ['-arch=compute_%s' % gpu_arch,
'-code=sm_%s' % gpu_arch, '-std=c++11']
if gpu_arch:
self.build_system.cxxflags += ['-arch=compute_%s' % gpu_arch,
'-code=sm_%s' % gpu_arch]

if kernel_version == 'sync':
self.build_system.cppflags = ['-D SYNCKERNEL=1']
Expand Down Expand Up @@ -59,6 +69,9 @@ def __init__(self, kernel_version):
'kesch:cn': {
'latency': (12.0, None, 0.10, 'us')
},
'*': {
'latency': (0.0, None, None, 'us')
}
},
'async': {
'dom:gpu': {
Expand All @@ -70,6 +83,9 @@ def __init__(self, kernel_version):
'kesch:cn': {
'latency': (5.7, None, 0.10, 'us')
},
'*': {
'latency': (0.0, None, None, 'us')
}
},
}

Expand Down

0 comments on commit 08dd452

Please sign in to comment.