Skip to content

Commit

Permalink
[L0 v2] fix error reporting for urUSM*Alloc
Browse files Browse the repository at this point in the history
match the spec behavior
  • Loading branch information
igchor committed Nov 14, 2024
1 parent 50ef8c9 commit d31979b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 6 additions & 2 deletions source/adapters/level_zero/v2/usm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@
namespace umf {
ur_result_t getProviderNativeError(const char *providerName,
int32_t nativeError) {
if (strcmp(providerName, "Level Zero") == 0) {
return ze2urResult(static_cast<ze_result_t>(nativeError));
if (strcmp(providerName, "LEVEL_ZERO") == 0) {
auto zeResult = static_cast<ze_result_t>(nativeError);
if (zeResult == ZE_RESULT_ERROR_UNSUPPORTED_SIZE) {
return UR_RESULT_ERROR_INVALID_USM_SIZE;
}
return ze2urResult(zeResult);
}

return UR_RESULT_ERROR_UNKNOWN;
Expand Down
3 changes: 0 additions & 3 deletions test/conformance/usm/usm_adapter_level_zero_v2.match
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
urUSMDeviceAllocTest.InvalidUSMSize/*
urUSMGetMemAllocInfoTest.Success/*___UR_USM_ALLOC_INFO_POOL
urUSMHostAllocTest.InvalidUSMSize/*
urUSMSharedAllocTest.InvalidUSMSize/*

0 comments on commit d31979b

Please sign in to comment.