diff --git a/include/oneapi/dpl/pstl/onedpl_config.h b/include/oneapi/dpl/pstl/onedpl_config.h index 2ef13c46f83..23dbbcb43aa 100644 --- a/include/oneapi/dpl/pstl/onedpl_config.h +++ b/include/oneapi/dpl/pstl/onedpl_config.h @@ -54,9 +54,15 @@ but OpenMP headers are not found or the compiler does not support OpenMP" #endif -#if (defined(SYCL_LANGUAGE_VERSION) || defined(CL_SYCL_LANGUAGE_VERSION)) && \ - (__has_include() || __has_include()) -# define _ONEDPL_SYCL_AVAILABLE 1 +#if defined(__INTEL_LLVM_COMPILER) && (defined(CL_SYCL_LANGUAGE_VERSION) || defined(SYCL_LANGUAGE_VERSION)) +# define _ONEDPL_SYCL_ENABLED_FOR_INTEL_LLVM 1 +#endif +#if (__has_include() || __has_include()) +// Intel(R) oneAPI DPC++/C++ Compiler is known to provide SYCL_LANGUAGE_VERSION with certain compiler options, +// while other implementations may require inclusion of sycl/sycl.hpp, which is not desired in onedpl_config.h +# if _ONEDPL_SYCL_ENABLED_FOR_INTEL_LLVM || !defined(__INTEL_LLVM_COMPILER) +# define _ONEDPL_SYCL_AVAILABLE 1 +# endif #endif #if ONEDPL_USE_DPCPP_BACKEND && !_ONEDPL_SYCL_AVAILABLE # error "Device execution policies are enabled, \ diff --git a/test/support/test_config.h b/test/support/test_config.h index 5814a4a4a07..d4813656466 100644 --- a/test/support/test_config.h +++ b/test/support/test_config.h @@ -89,12 +89,15 @@ #define _PSTL_SYCL_TEST_USM 1 // Enable test when the DPC++ backend is available -#if ((defined(CL_SYCL_LANGUAGE_VERSION) || defined(SYCL_LANGUAGE_VERSION)) && \ - (__has_include() || __has_include())) && \ +#if defined(__INTEL_LLVM_COMPILER) && (defined(CL_SYCL_LANGUAGE_VERSION) || defined(SYCL_LANGUAGE_VERSION)) +# define TEST_SYCL_ENABLED_FOR_INTEL_LLVM 1 +#endif +#if __has_include() || __has_include() && \ + (TEST_SYCL_ENABLED_FOR_INTEL_LLVM || !defined(__INTEL_LLVM_COMPILER)) && \ (!defined(ONEDPL_USE_DPCPP_BACKEND) || ONEDPL_USE_DPCPP_BACKEND != 0) -#define TEST_DPCPP_BACKEND_PRESENT 1 +# define TEST_DPCPP_BACKEND_PRESENT 1 #else -#define TEST_DPCPP_BACKEND_PRESENT 0 +# define TEST_DPCPP_BACKEND_PRESENT 0 #endif #ifdef __SYCL_UNNAMED_LAMBDA__