Skip to content

Commit c7086f7

Browse files
authored
Merge pull request #2330 from igchor/v2_usm_error
[L0 v2] fix error reporting for urUSM*Alloc
2 parents e9d94b1 + d31979b commit c7086f7

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

source/adapters/level_zero/v2/usm.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,12 @@
2222
namespace umf {
2323
ur_result_t getProviderNativeError(const char *providerName,
2424
int32_t nativeError) {
25-
if (strcmp(providerName, "Level Zero") == 0) {
26-
return ze2urResult(static_cast<ze_result_t>(nativeError));
25+
if (strcmp(providerName, "LEVEL_ZERO") == 0) {
26+
auto zeResult = static_cast<ze_result_t>(nativeError);
27+
if (zeResult == ZE_RESULT_ERROR_UNSUPPORTED_SIZE) {
28+
return UR_RESULT_ERROR_INVALID_USM_SIZE;
29+
}
30+
return ze2urResult(zeResult);
2731
}
2832

2933
return UR_RESULT_ERROR_UNKNOWN;
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
urUSMDeviceAllocTest.InvalidUSMSize/*
21
urUSMGetMemAllocInfoTest.Success/*___UR_USM_ALLOC_INFO_POOL
3-
urUSMHostAllocTest.InvalidUSMSize/*
4-
urUSMSharedAllocTest.InvalidUSMSize/*

0 commit comments

Comments
 (0)