Skip to content

Commit bc8a00a

Browse files
[SYCL] Include backend-specific header if exists (#4783)
https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html#sec:headers-and-namespaces introduces the backend specific headers "sycl/backend/<backend_name>.hpp" CTS tests assume that if backend macro is defined (e.g. SYCL_BACKEND_OPENCL) it is fully functional without extra includes. So the patch adds include of the backend specific header when the backend is enabled. The change should fix the recent massive failure of CTS tests with the error: implicit instantiation of undefined template 'sycl::interop<sycl::backend::opencl, sycl::platform>' Co-authored-by: Mikhail Lychkov <mikhail.lychkov@intel.com> Co-authored-by: Mikhail Lychkov <mikhail.lychkov@intel.com>
1 parent 8ee0d30 commit bc8a00a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

sycl/include/CL/sycl/feature_test.hpp.in

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ __SYCL_INLINE_NAMESPACE(cl) {
1111
namespace sycl {
1212

1313
#define SYCL_BACKEND_OPENCL 1
14+
1415
// Feature test macro definitions
1516

1617
// TODO: Move these feature-test macros to compiler driver.
@@ -46,3 +47,12 @@ namespace sycl {
4647

4748
} // namespace sycl
4849
} // __SYCL_INLINE_NAMESPACE(cl)
50+
51+
#include <CL/sycl/backend/opencl.hpp>
52+
// Level Zero backend header depends on external headers and should be
53+
// included by user application directly
54+
// #include <sycl/ext/oneapi/backend/level_zero.hpp>
55+
56+
#if SYCL_EXT_ONEAPI_BACKEND_CUDA
57+
#include <CL/sycl/backend/cuda.hpp>
58+
#endif

0 commit comments

Comments
 (0)