2424// ===----------------------------------------------------------------------===//
2525
2626#include " dpctl_utils_helper.h"
27+ #include " Config/dpctl_config.h"
2728#include < sstream>
2829#include < string>
2930
@@ -48,9 +49,11 @@ std::string DPCTL_DeviceTypeToStr(info::device_type devTy)
4849 case info::device_type::custom:
4950 ss << " custom" ;
5051 break ;
52+ #if __SYCL_COMPILER_VERSION < __SYCL_COMPILER_2023_SWITCHOVER
5153 case info::device_type::host:
5254 ss << " host" ;
5355 break ;
56+ #endif
5457 default :
5558 ss << " unknown" ;
5659 }
@@ -90,8 +93,10 @@ backend DPCTL_DPCTLBackendTypeToSyclBackend(DPCTLSyclBackendType BeTy)
9093 switch (BeTy) {
9194 case DPCTLSyclBackendType::DPCTL_CUDA:
9295 return backend::ext_oneapi_cuda;
96+ #if __SYCL_COMPILER_VERSION < __SYCL_COMPILER_2023_SWITCHOVER
9397 case DPCTLSyclBackendType::DPCTL_HOST:
9498 return backend::host;
99+ #endif
95100 case DPCTLSyclBackendType::DPCTL_LEVEL_ZERO:
96101 return backend::ext_oneapi_level_zero;
97102 case DPCTLSyclBackendType::DPCTL_OPENCL:
@@ -108,8 +113,10 @@ DPCTLSyclBackendType DPCTL_SyclBackendToDPCTLBackendType(backend B)
108113 switch (B) {
109114 case backend::ext_oneapi_cuda:
110115 return DPCTLSyclBackendType::DPCTL_CUDA;
116+ #if __SYCL_COMPILER_VERSION < __SYCL_COMPILER_2023_SWITCHOVER
111117 case backend::host:
112118 return DPCTLSyclBackendType::DPCTL_HOST;
119+ #endif
113120 case backend::ext_oneapi_level_zero:
114121 return DPCTLSyclBackendType::DPCTL_LEVEL_ZERO;
115122 case backend::opencl:
@@ -170,9 +177,11 @@ std::string DPCTL_AspectToStr(aspect aspectTy)
170177{
171178 std::stringstream ss;
172179 switch (aspectTy) {
180+ #if __SYCL_COMPILER_VERSION < __SYCL_COMPILER_2023_SWITCHOVER
173181 case aspect::host:
174182 ss << " host" ;
175183 break ;
184+ #endif
176185 case aspect::cpu:
177186 ss << " cpu" ;
178187 break ;
@@ -242,12 +251,14 @@ std::string DPCTL_AspectToStr(aspect aspectTy)
242251aspect DPCTL_StrToAspectType (const std::string &aspectTyStr)
243252{
244253 aspect aspectTy;
245- if (aspectTyStr == " host" ) {
246- aspectTy = aspect::host;
247- }
248- else if (aspectTyStr == " cpu" ) {
254+ if (aspectTyStr == " cpu" ) {
249255 aspectTy = aspect::cpu;
250256 }
257+ #if __SYCL_COMPILER_VERSION < __SYCL_COMPILER_2023_SWITCHOVER
258+ else if (aspectTyStr == " host" ) {
259+ aspectTy = aspect::host;
260+ }
261+ #endif
251262 else if (aspectTyStr == " gpu" ) {
252263 aspectTy = aspect::gpu;
253264 }
@@ -312,8 +323,10 @@ aspect DPCTL_StrToAspectType(const std::string &aspectTyStr)
312323aspect DPCTL_DPCTLAspectTypeToSyclAspect (DPCTLSyclAspectType AspectTy)
313324{
314325 switch (AspectTy) {
326+ #if __SYCL_COMPILER_VERSION < __SYCL_COMPILER_2023_SWITCHOVER
315327 case DPCTLSyclAspectType::host:
316328 return aspect::host;
329+ #endif
317330 case DPCTLSyclAspectType::cpu:
318331 return aspect::cpu;
319332 case DPCTLSyclAspectType::gpu:
@@ -360,8 +373,10 @@ aspect DPCTL_DPCTLAspectTypeToSyclAspect(DPCTLSyclAspectType AspectTy)
360373DPCTLSyclAspectType DPCTL_SyclAspectToDPCTLAspectType (aspect Aspect)
361374{
362375 switch (Aspect) {
376+ #if __SYCL_COMPILER_VERSION < __SYCL_COMPILER_2023_SWITCHOVER
363377 case aspect::host:
364378 return DPCTLSyclAspectType::host;
379+ #endif
365380 case aspect::cpu:
366381 return DPCTLSyclAspectType::cpu;
367382 case aspect::gpu:
@@ -487,9 +502,11 @@ std::string DPCTL_GetDeviceFilterString(const device &Device)
487502 case backend::opencl:
488503 ss << " opencl" ;
489504 break ;
505+ #if __SYCL_COMPILER_VERSION < __SYCL_COMPILER_2023_SWITCHOVER
490506 case backend::host:
491507 ss << " host" ;
492508 break ;
509+ #endif
493510 default :
494511 ss << " unknown" ;
495512 };
0 commit comments