Skip to content

Commit bc100db

Browse files
committed
[SYCL][HIP] Allow setting the arch from CMake
1 parent b0eaf3b commit bc100db

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

sycl/test/lit.cfg.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,12 @@
114114

115115
if triple == 'amdgcn-amd-amdhsa':
116116
config.available_features.add('hip_amd')
117-
# For AMD the specific GPU has to be specified with --offload-arch, only
118-
# compiler tests are run so hardcode the offload arch to gfx906
119-
additional_flags += ['-Xsycl-target-backend=amdgcn-amd-amdhsa',
120-
'--offload-arch=gfx906']
117+
# For AMD the specific GPU has to be specified with --offload-arch
118+
if not any([f.startswith('--offload-arch') for f in additional_flags]):
119+
# If the offload arch wasn't specified in SYCL_CLANG_EXTRA_FLAGS,
120+
# hardcode it to gfx906, this is fine because only compiler tests
121+
additional_flags += ['-Xsycl-target-backend=amdgcn-amd-amdhsa',
122+
'--offload-arch=gfx906']
121123

122124
llvm_config.use_clang(additional_flags=additional_flags)
123125

0 commit comments

Comments
 (0)