Skip to content

Commit 12fb842

Browse files
authored
hpctoolkit: add variants for gtpin and opencl (spack#31439)
Reorder a few options to better group them by function.
1 parent 37c9974 commit 12fb842

File tree

1 file changed

+37
-13
lines changed
  • var/spack/repos/builtin/packages/hpctoolkit

1 file changed

+37
-13
lines changed

var/spack/repos/builtin/packages/hpctoolkit/package.py

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,18 @@ class Hpctoolkit(AutotoolsPackage):
6464
description='Needed when MPICXX builds static binaries '
6565
'for the compute nodes.')
6666

67+
variant('cuda', default=False,
68+
description='Support CUDA on NVIDIA GPUs (2020.03.01 or later).')
69+
6770
variant('level_zero', default=False,
6871
description='Support Level Zero on Intel GPUs (2022.04.15 or later).')
6972

70-
variant('cuda', default=False,
71-
description='Support CUDA on NVIDIA GPUs (2020.03.01 or later).')
73+
variant('gtpin', default=False,
74+
description='Support instrumenting Intel GPU kernels with Intel GT-Pin '
75+
'(2022.05.15 or later, and requires level_zero).')
76+
77+
variant('opencl', default=False,
78+
description='Support OpenCL')
7279

7380
variant('rocm', default=False,
7481
description='Support ROCM on AMD GPUs (2022.04.15 or later).')
@@ -107,6 +114,10 @@ class Hpctoolkit(AutotoolsPackage):
107114

108115
depends_on('cuda', when='+cuda')
109116
depends_on('oneapi-level-zero', when='+level_zero')
117+
depends_on('oneapi-igc', when='+gtpin')
118+
depends_on('intel-gtpin', when='+gtpin')
119+
depends_on('opencl-c-headers', when='+opencl')
120+
110121
depends_on('intel-xed+pic', when='target=x86_64:')
111122
depends_on('memkind', type=('build', 'run'), when='@2021.05.01:')
112123
depends_on('papi', when='+papi')
@@ -131,6 +142,9 @@ class Hpctoolkit(AutotoolsPackage):
131142
conflicts('+cuda', when='@:2019',
132143
msg='cuda requires 2020.03.01 or later')
133144

145+
conflicts('+gtpin', when='~level_zero',
146+
msg='gtpin requires level_zero')
147+
134148
conflicts('+rocm', when='@:2022.03',
135149
msg='rocm requires 2022.04.15 or later')
136150

@@ -168,24 +182,19 @@ def configure_args(self):
168182
]
169183

170184
if spec.satisfies('@:master'):
171-
args.append('--with-binutils=%s' % spec['binutils'].prefix)
172-
args.append('--with-libdwarf=%s' % spec['libdwarf'].prefix)
173-
174-
if '+cuda' in spec:
175-
args.append('--with-cuda=%s' % spec['cuda'].prefix)
176-
177-
if '+level_zero' in spec:
178-
args.append('--with-level0=%s' % spec['oneapi-level-zero'].prefix)
185+
args.extend([
186+
'--with-binutils=%s' % spec['binutils'].prefix,
187+
'--with-libdwarf=%s' % spec['libdwarf'].prefix,
188+
])
189+
else:
190+
args.append('--with-libiberty=%s' % spec['libiberty'].prefix)
179191

180192
if spec.satisfies('@:2020.09'):
181193
args.append('--with-gotcha=%s' % spec['gotcha'].prefix)
182194

183195
if spec.target.family == 'x86_64':
184196
args.append('--with-xed=%s' % spec['intel-xed'].prefix)
185197

186-
if spec.satisfies('@develop'):
187-
args.append('--with-libiberty=%s' % spec['libiberty'].prefix)
188-
189198
if spec.satisfies('@:2022.03'):
190199
args.append('--with-mbedtls=%s' % spec['mbedtls'].prefix)
191200

@@ -197,6 +206,21 @@ def configure_args(self):
197206
else:
198207
args.append('--with-perfmon=%s' % spec['libpfm4'].prefix)
199208

209+
if '+cuda' in spec:
210+
args.append('--with-cuda=%s' % spec['cuda'].prefix)
211+
212+
if '+level_zero' in spec:
213+
args.append('--with-level0=%s' % spec['oneapi-level-zero'].prefix)
214+
215+
if '+opencl' in spec:
216+
args.append('--with-opencl=%s' % spec['opencl-c-headers'].prefix)
217+
218+
if '+gtpin' in spec:
219+
args.extend([
220+
'--with-gtpin=%s' % spec['intel-gtpin'].prefix,
221+
'--with-igc=%s' % spec['oneapi-igc'].prefix,
222+
])
223+
200224
if spec.satisfies('+rocm'):
201225
args.extend([
202226
'--with-rocm-hip=%s' % spec['hip'].prefix,

0 commit comments

Comments
 (0)