From 78715b077c21b01cf8d443dec359348ccb2e818f Mon Sep 17 00:00:00 2001 From: Nicolas Miller Date: Wed, 26 Mar 2025 11:13:35 +0000 Subject: [PATCH] [SYCL] Fix CUDA interop self-contained-headers test This header needs a sepcific macro to be defined when it is included which is why the generic test gives out warnings. Add a specific test for it so we can define the macro. --- sycl/test/self-contained-headers/lit.local.cfg | 3 --- .../sycl/ext/oneapi/experimental/backend/cuda.hpp.cpp | 9 +++++++++ 2 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 sycl/test/self-contained-headers/sycl/ext/oneapi/experimental/backend/cuda.hpp.cpp diff --git a/sycl/test/self-contained-headers/lit.local.cfg b/sycl/test/self-contained-headers/lit.local.cfg index d61551742dd85..9641fdb488397 100644 --- a/sycl/test/self-contained-headers/lit.local.cfg +++ b/sycl/test/self-contained-headers/lit.local.cfg @@ -7,9 +7,6 @@ config.test_format = SYCLHeadersTest() # standalone. `os.path.join` is required here so the filtering works # cross-platform config.sycl_headers_xfail = [ - os.path.join( - "sycl", "ext", "oneapi", "experimental", "backend", "cuda.hpp" - ), os.path.join( "sycl", "ext", "intel", "esimd", "detail", "types_elementary.hpp" ), diff --git a/sycl/test/self-contained-headers/sycl/ext/oneapi/experimental/backend/cuda.hpp.cpp b/sycl/test/self-contained-headers/sycl/ext/oneapi/experimental/backend/cuda.hpp.cpp new file mode 100644 index 0000000000000..09a56af7faa70 --- /dev/null +++ b/sycl/test/self-contained-headers/sycl/ext/oneapi/experimental/backend/cuda.hpp.cpp @@ -0,0 +1,9 @@ +// RUN: %clangxx -fsycl -fsyntax-only -Xclang -verify %s +// expected-no-diagnostics +// +// Check that the experimental CUDA interop header doesn't have any warnings. +// This is a special test because this header requires a specific macro to be +// set when it is included. + +#define SYCL_EXT_ONEAPI_BACKEND_CUDA_EXPERIMENTAL +#include