Skip to content

Commit 56ba791

Browse files
addressed sycl deprecation warnings. Changes DPCTL aspect enum to align with SYCL aspect renaming: usm_system_allocators->usm_system_allocations
1 parent 550c6f0 commit 56ba791

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

libsyclinterface/helper/source/dpctl_error_handlers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ void DPCTL_AsyncErrorHandler::operator()(
3939
std::rethrow_exception(e);
4040
} catch (sycl::exception const &e) {
4141
error_handler(e, __FILE__, __func__, __LINE__);
42-
auto err_code = e.get_cl_code();
42+
auto err_code = e.code();
4343
handler_(static_cast<int>(err_code));
4444
}
4545
}

libsyclinterface/helper/source/dpctl_utils_helper.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,8 @@ std::string DPCTL_AspectToStr(aspect aspectTy)
221221
case aspect::usm_restricted_shared_allocations:
222222
ss << "usm_restricted_shared_allocations";
223223
break;
224-
case aspect::usm_system_allocator:
225-
ss << "usm_system_allocator";
224+
case aspect::usm_system_allocations:
225+
ss << "usm_system_allocations";
226226
break;
227227
default:
228228
throw std::runtime_error("Unsupported aspect type");
@@ -287,8 +287,8 @@ aspect DPCTL_StrToAspectType(const std::string &aspectTyStr)
287287
else if (aspectTyStr == "usm_restricted_shared_allocations") {
288288
aspectTy = aspect::usm_restricted_shared_allocations;
289289
}
290-
else if (aspectTyStr == "usm_system_allocator") {
291-
aspectTy = aspect::usm_system_allocator;
290+
else if (aspectTyStr == "usm_system_allocations") {
291+
aspectTy = aspect::usm_system_allocations;
292292
}
293293
else {
294294
// \todo handle the error
@@ -334,8 +334,8 @@ aspect DPCTL_DPCTLAspectTypeToSyclAspect(DPCTLSyclAspectType AspectTy)
334334
return aspect::usm_shared_allocations;
335335
case DPCTLSyclAspectType::usm_restricted_shared_allocations:
336336
return aspect::usm_restricted_shared_allocations;
337-
case DPCTLSyclAspectType::usm_system_allocator:
338-
return aspect::usm_system_allocator;
337+
case DPCTLSyclAspectType::usm_system_allocations:
338+
return aspect::usm_system_allocations;
339339
default:
340340
throw std::runtime_error("Unsupported aspect type");
341341
}
@@ -378,8 +378,8 @@ DPCTLSyclAspectType DPCTL_SyclAspectToDPCTLAspectType(aspect Aspect)
378378
return DPCTLSyclAspectType::usm_shared_allocations;
379379
case aspect::usm_restricted_shared_allocations:
380380
return DPCTLSyclAspectType::usm_restricted_shared_allocations;
381-
case aspect::usm_system_allocator:
382-
return DPCTLSyclAspectType::usm_system_allocator;
381+
case aspect::usm_system_allocations:
382+
return DPCTLSyclAspectType::usm_system_allocations;
383383
default:
384384
throw std::runtime_error("Unsupported aspect type");
385385
}

libsyclinterface/include/dpctl_sycl_enum_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ typedef enum
119119
usm_host_allocations,
120120
usm_shared_allocations,
121121
usm_restricted_shared_allocations,
122-
usm_system_allocator
122+
usm_system_allocations
123123
} DPCTLSyclAspectType;
124124

125125
/*!

libsyclinterface/source/dpctl_sycl_program_interface.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ DPCTLProgram_CreateFromSpirv(__dpctl_keep const DPCTLSyclContextRef CtxRef,
223223
case backend::opencl:
224224
Pref = createOpenCLInterOpProgram(*SyclCtx, IL, length, CompileOpts);
225225
break;
226-
case backend::level_zero:
226+
case backend::ext_oneapi_level_zero:
227227
#ifdef DPCTL_ENABLE_LO_PROGRAM_CREATION
228228
Pref = createLevelZeroInterOpProgram(*SyclCtx, IL, length, CompileOpts);
229229
#endif
@@ -274,7 +274,7 @@ DPCTLProgram_CreateFromOCLSource(__dpctl_keep const DPCTLSyclContextRef Ctx,
274274
return nullptr;
275275
}
276276
break;
277-
case backend::level_zero:
277+
case backend::ext_oneapi_level_zero:
278278
error_handler("CreateFromSource is not supported in Level Zero.",
279279
__FILE__, __func__, __LINE__);
280280
delete SyclProgram;

libsyclinterface/source/dpctl_sycl_queue_interface.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ DPCTLSyclEventRef DPCTLQueue_MemAdvise(__dpctl_keep DPCTLSyclQueueRef QRef,
530530
if (Q) {
531531
sycl::event ev;
532532
try {
533-
ev = Q->mem_advise(Ptr, Count, static_cast<pi_mem_advice>(Advice));
533+
ev = Q->mem_advise(Ptr, Count, Advice);
534534
} catch (std::exception const &e) {
535535
error_handler(e, __FILE__, __func__, __LINE__);
536536
return nullptr;
@@ -592,7 +592,7 @@ __dpctl_give DPCTLSyclEventRef DPCTLQueue_SubmitBarrierForEvents(
592592
for (auto i = 0ul; i < NDepEvents; ++i)
593593
cgh.depends_on(*unwrap(DepEvents[i]));
594594

595-
cgh.barrier();
595+
cgh.ext_oneapi_barrier();
596596
});
597597
} catch (std::exception const &e) {
598598
error_handler(e, __FILE__, __func__, __LINE__);

0 commit comments

Comments
 (0)