Skip to content

Commit 1d1dcc6

Browse files
Fence uses of is_host, backend::host with __SYCL_COMPILER_VERSION conditional
1 parent 9c1db5f commit 1d1dcc6

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

libsyclinterface/source/dpctl_sycl_context_interface.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,11 @@ bool DPCTLContext_IsHost(__dpctl_keep const DPCTLSyclContextRef CtxRef)
169169
{
170170
auto Ctx = unwrap<context>(CtxRef);
171171
if (Ctx) {
172+
#if __SYCL_COMPILER_VERSION >= 20221020L
173+
return false;
174+
#else
172175
return Ctx->is_host();
176+
#endif
173177
}
174178
return false;
175179
}
@@ -189,8 +193,10 @@ DPCTLContext_GetBackend(__dpctl_keep const DPCTLSyclContextRef CtxRef)
189193
auto BE = unwrap<context>(CtxRef)->get_platform().get_backend();
190194

191195
switch (BE) {
196+
#if __SYCL_COMPILER_VERSION < 20221020L
192197
case backend::host:
193198
return DPCTL_HOST;
199+
#endif
194200
case backend::opencl:
195201
return DPCTL_OPENCL;
196202
case backend::ext_oneapi_level_zero:

libsyclinterface/source/dpctl_sycl_device_interface.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,11 @@ bool DPCTLDevice_IsHost(__dpctl_keep const DPCTLSyclDeviceRef DRef)
179179
{
180180
auto D = unwrap<device>(DRef);
181181
if (D) {
182+
#if __SYCL_COMPILER_VERSION >= 20221020L
183+
return false;
184+
#else
182185
return D->is_host();
186+
#endif
183187
}
184188
return false;
185189
}

libsyclinterface/source/dpctl_sycl_platform_manager.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@ std::string platform_print_info_impl(const platform &p, size_t verbosity)
7070
<< p.get_info<info::platform::version>() << _endl << std::setw(4)
7171
<< " " << std::left << std::setw(12) << "Vendor" << vendor << _endl
7272
<< std::setw(4) << " " << std::left << std::setw(12) << "Backend";
73+
#if __SYCL_COMPILER_VERSION >= 20221020L
74+
ss << p.get_backend();
75+
#else
7376
p.is_host() ? (ss << "unknown") : (ss << p.get_backend());
77+
#endif
7478
ss << _endl;
7579

7680
// Get number of devices on the platform

0 commit comments

Comments
 (0)