Skip to content

Commit 8b2d02c

Browse files
committed
[L0 v2] fix error reporting for urUSM*Alloc
match the spec behavior
1 parent b64bdc1 commit 8b2d02c

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

source/adapters/level_zero/v2/usm.cpp

Lines changed: 6 additions & 2 deletions
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;
Lines changed: 0 additions & 3 deletions
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)