Skip to content

Commit 4fcb1e7

Browse files
committed
[SYCL][ROCm] Fixup architecture flag in lit tests
1 parent 811395e commit 4fcb1e7

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

sycl/doc/GetStartedGuide.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,8 @@ If CUDA support has been built, it is tested only if there are CUDA devices
425425
available.
426426
427427
If testing with ROCm for AMD make sure to specify the GPU being used
428-
by adding `-mcpu=<target>` to the CMake variable
428+
by adding `-Xsycl-target-backend=amdgcn-amd-amdhsa-sycldevice
429+
--offload-arch=<target>` to the CMake variable
429430
`SYCL_CLANG_EXTRA_FLAGS`.
430431
431432
#### Run DPC++ E2E test suite

sycl/test/lit.cfg.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,11 @@
105105

106106
if triple == 'amdgcn-amd-amdhsa-sycldevice':
107107
config.available_features.add('rocm_amd')
108-
# For AMD the specific GPU has to be specified with -mcpu
109-
if not re.match('.*-mcpu.*', config.sycl_clang_extra_flags):
110-
raise Exception("Error: missing -mcpu flag when trying to run lit " \
111-
"tests for AMD GPU, please add `-mcpu=<target>` to " \
108+
# For AMD the specific GPU has to be specified with --offload-arch
109+
if not re.match('.*--offload-arch.*', config.sycl_clang_extra_flags):
110+
raise Exception("Error: missing --offload-arch flag when trying to " \
111+
"run lit tests for AMD GPU, please add " \
112+
"`-Xsycl-target-backend=amdgcn-amd-amdhsa-sycldevice --offload-arch=<target>` to " \
112113
"the CMake variable SYCL_CLANG_EXTRA_FLAGS")
113114

114115
# Set timeout for test = 10 mins

sycl/test/on-device/lit.cfg.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,12 @@ def getDeviceCount(device_type):
242242
config.available_features.add('level_zero')
243243
elif rocm_amd:
244244
config.available_features.add('rocm_amd')
245-
# For AMD the specific GPU has to be specified with -mcpu
246-
if not re.match('.*-mcpu.*', config.sycl_clang_extra_flags):
247-
raise Exception("Error: missing -mcpu flag when trying to run lit " \
248-
"tests for AMD GPU, please add `-mcpu=<target>` to " \
249-
"the CMake variable SYCL_CLANG_EXTRA_FLAGS")
245+
# For AMD the specific GPU has to be specified with --offload-arch
246+
if not re.match('.*--offload-arch.*', config.sycl_clang_extra_flags):
247+
raise Exception("Error: missing --offload-arch flag when trying to " \
248+
"run lit tests for AMD GPU, please add " \
249+
"`-Xsycl-target-backend=amdgcn-amd-amdhsa-sycldevice --offload-arch=<target>` to " \
250+
"the CMake variable SYCL_CLANG_EXTRA_FLAGS")
250251
elif rocm_nvidia:
251252
config.available_features.add('rocm_nvidia')
252253

0 commit comments

Comments
 (0)