Skip to content

Commit ec3ee3a

Browse files
Do not use aspect::host in 2023 compiler, since it is also deprecated
1 parent 6052ba0 commit ec3ee3a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

libsyclinterface/helper/source/dpctl_utils_helper.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,11 @@ std::string DPCTL_AspectToStr(aspect aspectTy)
177177
{
178178
std::stringstream ss;
179179
switch (aspectTy) {
180+
#if __SYCL_COMPILER_VERSION < __SYCL_COMPILER_2023_SWITCHOVER
180181
case aspect::host:
181182
ss << "host";
182183
break;
184+
#endif
183185
case aspect::cpu:
184186
ss << "cpu";
185187
break;
@@ -249,9 +251,13 @@ std::string DPCTL_AspectToStr(aspect aspectTy)
249251
aspect DPCTL_StrToAspectType(const std::string &aspectTyStr)
250252
{
251253
aspect aspectTy;
252-
if (aspectTyStr == "host") {
254+
if (false) {
255+
}
256+
#if __SYCL_COMPILER_VERSION < __SYCL_COMPILER_2023_SWITCHOVER
257+
else if (aspectTyStr == "host") {
253258
aspectTy = aspect::host;
254259
}
260+
#endif
255261
else if (aspectTyStr == "cpu") {
256262
aspectTy = aspect::cpu;
257263
}
@@ -319,8 +325,10 @@ aspect DPCTL_StrToAspectType(const std::string &aspectTyStr)
319325
aspect DPCTL_DPCTLAspectTypeToSyclAspect(DPCTLSyclAspectType AspectTy)
320326
{
321327
switch (AspectTy) {
328+
#if __SYCL_COMPILER_VERSION < __SYCL_COMPILER_2023_SWITCHOVER
322329
case DPCTLSyclAspectType::host:
323330
return aspect::host;
331+
#endif
324332
case DPCTLSyclAspectType::cpu:
325333
return aspect::cpu;
326334
case DPCTLSyclAspectType::gpu:
@@ -367,8 +375,10 @@ aspect DPCTL_DPCTLAspectTypeToSyclAspect(DPCTLSyclAspectType AspectTy)
367375
DPCTLSyclAspectType DPCTL_SyclAspectToDPCTLAspectType(aspect Aspect)
368376
{
369377
switch (Aspect) {
378+
#if __SYCL_COMPILER_VERSION < __SYCL_COMPILER_2023_SWITCHOVER
370379
case aspect::host:
371380
return DPCTLSyclAspectType::host;
381+
#endif
372382
case aspect::cpu:
373383
return DPCTLSyclAspectType::cpu;
374384
case aspect::gpu:

0 commit comments

Comments
 (0)