Skip to content

Commit

Permalink
[SYCL][E2E] Re-enable interop_all_backends.cpp test (#15767)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ayylol authored Oct 25, 2024
1 parent 1ed687b commit 7e2d615
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions sycl/test-e2e/Basic/interop/interop_all_backends.cpp
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
// REQUIRES: CUDA || HIP
// 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
// XFAIL: any-device-is-opencl, any-device-is-cuda, (windows && any-device-is-level_zero)
// XFAIL-TRACKER: https://github.com/intel/llvm/issues/15819
// RUN: %if any-device-is-opencl %{ %{build} -o %t-opencl.out %}
// RUN: %if any-device-is-level_zero %{ %{build} -DBUILD_FOR_L0 -o %t-l0.out %}
// RUN: %if any-device-is-cuda %{ %{build} -DBUILD_FOR_CUDA -o %t-cuda.out %}
// RUN: %if any-device-is-hip %{ %{build} -DBUILD_FOR_HIP -o %t-hip.out %}

#include <sycl/backend.hpp>
#include <sycl/detail/core.hpp>
#include <sycl/properties/all_properties.hpp>
#include <sycl/usm.hpp>
using namespace sycl;

#ifdef SYCL_EXT_ONEAPI_BACKEND_CUDA_EXPERIMENTAL
#ifdef BUILD_FOR_CUDA
#include <sycl/ext/oneapi/experimental/backend/cuda.hpp>
constexpr auto BACKEND = backend::ext_oneapi_cuda;
using nativeDevice = CUdevice;
using nativeQueue = CUstream;
using nativeEvent = CUevent;
#elif defined(SYCL_EXT_ONEAPI_BACKEND_HIP)
#elif defined(BUILD_FOR_HIP)
#include <sycl/ext/oneapi/backend/hip.hpp>
constexpr auto BACKEND = backend::ext_oneapi_hip;
using nativeDevice = hipDevice_t;
using nativeQueue = hipStream_t;
using nativeEvent = hipEvent_t;
#elif defined(SYCL_EXT_ONEAPI_BACKEND_L0)
#elif defined(BUILD_FOR_L0)
constexpr auto BACKEND = backend::ext_oneapi_level_zero;
using nativeDevice = ze_device_handle_t;
using nativeQueue = ze_command_queue_handle_t;
Expand Down

0 comments on commit 7e2d615

Please sign in to comment.