Skip to content

Commit 7e2d615

Browse files
authored
[SYCL][E2E] Re-enable interop_all_backends.cpp test (#15767)
The capitalization of cuda and hip in `Basic/interop/interop_all_backends.cpp` makes the test always unsupported. This patch removes the requires line, and refactors how the test is built so that we build an executable for each backend.
1 parent 1ed687b commit 7e2d615

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

sycl/test-e2e/Basic/interop/interop_all_backends.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
1-
// REQUIRES: CUDA || HIP
2-
// RUN: %{build} %if hip %{ -DSYCL_EXT_ONEAPI_BACKEND_HIP %} %else %{ %if cuda %{ -DSYCL_EXT_ONEAPI_BACKEND_CUDA_EXPERIMENTAL %} %else %{ %if level_zero %{ -DSYCL_EXT_ONEAPI_BACKEND_L0 %} %} %} -o %t.out
1+
// XFAIL: any-device-is-opencl, any-device-is-cuda, (windows && any-device-is-level_zero)
2+
// XFAIL-TRACKER: https://github.com/intel/llvm/issues/15819
3+
// RUN: %if any-device-is-opencl %{ %{build} -o %t-opencl.out %}
4+
// RUN: %if any-device-is-level_zero %{ %{build} -DBUILD_FOR_L0 -o %t-l0.out %}
5+
// RUN: %if any-device-is-cuda %{ %{build} -DBUILD_FOR_CUDA -o %t-cuda.out %}
6+
// RUN: %if any-device-is-hip %{ %{build} -DBUILD_FOR_HIP -o %t-hip.out %}
37

48
#include <sycl/backend.hpp>
59
#include <sycl/detail/core.hpp>
610
#include <sycl/properties/all_properties.hpp>
711
#include <sycl/usm.hpp>
812
using namespace sycl;
913

10-
#ifdef SYCL_EXT_ONEAPI_BACKEND_CUDA_EXPERIMENTAL
14+
#ifdef BUILD_FOR_CUDA
1115
#include <sycl/ext/oneapi/experimental/backend/cuda.hpp>
1216
constexpr auto BACKEND = backend::ext_oneapi_cuda;
1317
using nativeDevice = CUdevice;
1418
using nativeQueue = CUstream;
1519
using nativeEvent = CUevent;
16-
#elif defined(SYCL_EXT_ONEAPI_BACKEND_HIP)
20+
#elif defined(BUILD_FOR_HIP)
1721
#include <sycl/ext/oneapi/backend/hip.hpp>
1822
constexpr auto BACKEND = backend::ext_oneapi_hip;
1923
using nativeDevice = hipDevice_t;
2024
using nativeQueue = hipStream_t;
2125
using nativeEvent = hipEvent_t;
22-
#elif defined(SYCL_EXT_ONEAPI_BACKEND_L0)
26+
#elif defined(BUILD_FOR_L0)
2327
constexpr auto BACKEND = backend::ext_oneapi_level_zero;
2428
using nativeDevice = ze_device_handle_t;
2529
using nativeQueue = ze_command_queue_handle_t;

0 commit comments

Comments
 (0)