Skip to content

Commit 84424ae

Browse files
committed
[SYCL][ROCm] Setup lit tests for ROCm plugin
1 parent 104b45e commit 84424ae

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+224
-3
lines changed

sycl/doc/GetStartedGuide.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,10 @@ skipped.
424424
If CUDA support has been built, it is tested only if there are CUDA devices
425425
available.
426426
427+
If testing with ROCm for AMD make sure to specify the GPU being used
428+
by adding `-mcpu=<target>` to the CMake variable
429+
`SYCL_CLANG_EXTRA_FLAGS`.
430+
427431
#### Run DPC++ E2E test suite
428432
429433
Follow instructions from the link below to build and run tests:

sycl/test/CMakeLists.txt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,34 @@ if(SYCL_BUILD_PI_CUDA)
7575
add_custom_target(check-sycl-cuda)
7676
add_dependencies(check-sycl-cuda check-sycl-ptx)
7777
add_dependencies(check-sycl check-sycl-cuda)
78+
endif()
79+
80+
if(SYCL_BUILD_PI_ROCM)
81+
add_custom_target(check-sycl-rocm)
82+
if("${SYCL_BUILD_PI_ROCM_PLATFORM}" STREQUAL "NVIDIA")
83+
add_lit_testsuite(check-sycl-rocm-ptx "Running device-agnostic SYCL regression tests for ROCm NVidia PTX"
84+
${CMAKE_CURRENT_BINARY_DIR}
85+
ARGS ${RT_TEST_ARGS}
86+
PARAMS "SYCL_TRIPLE=nvptx64-nvidia-cuda-sycldevice;SYCL_PLUGIN=rocm"
87+
DEPENDS ${SYCL_TEST_DEPS}
88+
EXCLUDE_FROM_CHECK_ALL
89+
)
90+
91+
add_dependencies(check-sycl-rocm check-sycl-rocm-ptx)
92+
elseif("${SYCL_BUILD_PI_ROCM_PLATFORM}" STREQUAL "AMD")
93+
add_lit_testsuite(check-sycl-rocm-gcn "Running device-agnostic SYCL regression tests for ROCm AMDGCN"
94+
${CMAKE_CURRENT_BINARY_DIR}
95+
ARGS ${RT_TEST_ARGS}
96+
PARAMS "SYCL_TRIPLE=amdgcn-amd-amdhsa-sycldevice;SYCL_PLUGIN=rocm"
97+
DEPENDS ${SYCL_TEST_DEPS}
98+
EXCLUDE_FROM_CHECK_ALL
99+
)
100+
101+
add_dependencies(check-sycl-rocm check-sycl-rocm-gcn)
102+
else()
103+
message(FATAL_ERROR "SYCL_BUILD_PI_ROCM_PLATFORM must be set to either 'AMD' or 'NVIDIA' (set to: '${SYCL_BUILD_PI_ROCM_PLATFORM}')")
104+
endif()
78105

106+
add_dependencies(check-sycl check-sycl-rocm)
79107
endif()
80108
add_subdirectory(on-device)

sycl/test/atomic_ref/accessor.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
// RUN: %clangxx -fsycl -fsycl-unnamed-lambda -fsycl-targets=%sycl_triple %s -o %t.out
22
// RUN: %RUN_ON_HOST %t.out
3+
//
4+
// Missing __clc_atomic_store_local_4_unordered on AMD
5+
// XFAIL: rocm_amd
36

47
#include <CL/sycl.hpp>
58
#include <algorithm>

sycl/test/atomic_ref/add.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
// RUN: -fsycl-device-only -S %s -o - | FileCheck %s --check-prefix=CHECK-LLVM-EMU
55
// RUN: %clangxx -fsycl -fsycl-unnamed-lambda -fsycl-targets=%sycl_triple %s -o %t.out
66
// RUN: %RUN_ON_HOST %t.out
7+
//
8+
// Missing __clc__atomic_uload_global_4_unordered,
9+
// __clc__atomic_uload_global_8_unordered with AMD:
10+
// XFAIL: rocm_amd
711

812
#include <CL/sycl.hpp>
913
#include <algorithm>

sycl/test/atomic_ref/load.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
// RUN: | FileCheck %s --check-prefix=CHECK-LLVM
33
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
44
// RUN: %RUN_ON_HOST %t.out
5+
//
6+
// Missing __clc__atomic_load_global_4_unordered,
7+
// __clc__atomic_uload_global_4_unordered,
8+
// __clc__atomic_load_global_8_unordered and
9+
// __clc__atomic_uload_global_8_unordereud on AMD:
10+
// XFAIL: rocm_amd
511

612
#include <CL/sycl.hpp>
713
#include <algorithm>

sycl/test/atomic_ref/max.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
// RUN: -fsycl-device-only -S %s -o - | FileCheck %s --check-prefix=CHECK-LLVM-EMU
55
// RUN: %clangxx -fsycl -fsycl-unnamed-lambda -fsycl-targets=%sycl_triple %s -o %t.out
66
// RUN: %RUN_ON_HOST %t.out
7+
//
8+
// Missing __clc__sync_fetch_and_max_global_8,
9+
// __clc__sync_fetch_and_umax_global_8, __clc__atomic_uload_global_4_unordered,
10+
// __clc__atomic_uload_global_8_unordered with AMD:
11+
// XFAIL: rocm_amd
712

813
#include <CL/sycl.hpp>
914
#include <algorithm>

sycl/test/atomic_ref/min.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
// RUN: -fsycl-device-only -S %s -o - | FileCheck %s --check-prefix=CHECK-LLVM-EMU
55
// RUN: %clangxx -fsycl -fsycl-unnamed-lambda -fsycl-targets=%sycl_triple %s -o %t.out
66
// RUN: %RUN_ON_HOST %t.out
7+
//
8+
// Missing __clc__sync_fetch_and_min_global_8,
9+
// __clc__sync_fetch_and_umin_global_8, __clc__atomic_uload_global_4_unordered,
10+
// __clc__atomic_uload_global_8_unordered with AMD:
11+
// XFAIL: rocm_amd
712

813
#include <CL/sycl.hpp>
914
#include <algorithm>

sycl/test/atomic_ref/store.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
// RUN: | FileCheck %s --check-prefix=CHECK-LLVM
33
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
44
// RUN: %RUN_ON_HOST %t.out
5+
//
6+
// Missing __clc__atomic_store_global_4_unordered,
7+
// __clc__atomic_ustore_global_4_unordered,
8+
// __clc__atomic_store_global_8_unordered and
9+
// __clc__atomic_ustore_global_8_unordereud on AMD:
10+
// XFAIL: rocm_amd
511

612
#include <CL/sycl.hpp>
713
#include <algorithm>

sycl/test/atomic_ref/sub.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
// RUN: -fsycl-device-only -S %s -o - | FileCheck %s --check-prefix=CHECK-LLVM-EMU
55
// RUN: %clangxx -fsycl -fsycl-unnamed-lambda -fsycl-targets=%sycl_triple %s -o %t.out
66
// RUN: %RUN_ON_HOST %t.out
7+
//
8+
// Missing __clc__atomic_uload_global_4_unordered,
9+
// __clc__atomic_uload_global_8_unordered with AMD:
10+
// XFAIL: rocm_amd
711

812
#include <CL/sycl.hpp>
913
#include <algorithm>

sycl/test/basic_tests/built-ins.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33

44
// CUDA does not support printf.
55
// UNSUPPORTED: cuda
6+
//
7+
// Hits an assertion with AMD:
8+
// XFAIL: rocm_amd
9+
610
#include <CL/sycl.hpp>
711

812
#include <cassert>

0 commit comments

Comments
 (0)