Skip to content

Commit b5f855d

Browse files
test/support/utils_sycl_defs.h - fix compile error
In file included from test/xpu_api/language.support/support.limits/limits/quiet_NaN.pass.cpp:20: In file included from test/support/test_complex.h:23: In file included from test/support/utils.h:47: In file included from test/support/utils_test_base.h:25: In file included from test/support/utils_invoke.h:25: test/support/utils_sycl_defs.h:24:14: fatal error: 'CL/sycl.hpp' file not found 24 | # include <CL/sycl.hpp> | ^~~~~~~~~~~~~
1 parent 3259c72 commit b5f855d

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

test/support/utils_sycl_defs.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@
1818
#ifndef _UTILS_SYCL_DEFS_H
1919
#define _UTILS_SYCL_DEFS_H
2020

21-
#if __has_include(<sycl/sycl.hpp>)
22-
# include <sycl/sycl.hpp>
23-
#else
24-
# include <CL/sycl.hpp>
21+
#if _ONEDPL_BACKEND_SYCL
22+
# if __has_include(<sycl/sycl.hpp>)
23+
# include <sycl/sycl.hpp>
24+
# else
25+
# include <CL/sycl.hpp>
26+
# endif
2527
#endif
2628

2729
#if ONEDPL_FPGA_DEVICE
@@ -38,13 +40,14 @@
3840

3941
namespace TestUtils
4042
{
41-
43+
#if _ONEDPL_BACKEND_SYCL
4244
template <sycl::usm::alloc alloc_type>
4345
constexpr std::size_t
4446
uniq_kernel_index()
4547
{
4648
return static_cast<std::underlying_type_t<sycl::usm::alloc>>(alloc_type);
4749
}
50+
#endif
4851

4952
template <typename Op, std::size_t CallNumber>
5053
struct unique_kernel_name;

0 commit comments

Comments
 (0)