From bc8a00ac79ff5c77c63a729e0e975d85f790db31 Mon Sep 17 00:00:00 2001 From: vladimirlaz Date: Wed, 20 Oct 2021 18:22:15 +0300 Subject: [PATCH] [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/.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' Co-authored-by: Mikhail Lychkov Co-authored-by: Mikhail Lychkov --- sycl/include/CL/sycl/feature_test.hpp.in | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sycl/include/CL/sycl/feature_test.hpp.in b/sycl/include/CL/sycl/feature_test.hpp.in index 7d775c006d370..9b8d7fb6cd6d0 100644 --- a/sycl/include/CL/sycl/feature_test.hpp.in +++ b/sycl/include/CL/sycl/feature_test.hpp.in @@ -11,6 +11,7 @@ __SYCL_INLINE_NAMESPACE(cl) { namespace sycl { #define SYCL_BACKEND_OPENCL 1 + // Feature test macro definitions // TODO: Move these feature-test macros to compiler driver. @@ -46,3 +47,12 @@ namespace sycl { } // namespace sycl } // __SYCL_INLINE_NAMESPACE(cl) + +#include +// Level Zero backend header depends on external headers and should be +// included by user application directly +// #include + +#if SYCL_EXT_ONEAPI_BACKEND_CUDA +#include +#endif