Skip to content

Commit ef8b198

Browse files
Use preprocessor to be able to build dpctl with oneAPI 2021.3
In oneAPI 2021.3 the namespace of filter_selector class is different
1 parent f2ab6f4 commit ef8b198

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

dpctl-capi/source/dpctl_sycl_device_selector_interface.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,13 @@ __dpctl_give DPCTLSyclDeviceSelectorRef DPCTLCPUSelector_Create()
8282
__dpctl_give DPCTLSyclDeviceSelectorRef
8383
DPCTLFilterSelector_Create(__dpctl_keep const char *filter_str)
8484
{
85+
#if __SYCL_COMPILER_VERSION < 20210925
86+
using filter_selector_t = sycl::ONEAPI::filter_selector;
87+
#else
88+
using filter_selector_t = sycl::ext::oneapi::filter_selector;
89+
#endif
8590
try {
86-
auto Selector = new ext::oneapi::filter_selector(filter_str);
91+
auto Selector = new filter_selector_t(filter_str);
8792
return wrap(Selector);
8893
} catch (std::bad_alloc &ba) {
8994
std::cerr << ba.what() << '\n';

0 commit comments

Comments
 (0)