Skip to content

Commit

Permalink
Merge pull request #2330 from igchor/v2_usm_error
Browse files Browse the repository at this point in the history
[L0 v2] fix error reporting for urUSM*Alloc
  • Loading branch information
pbalcer authored Nov 25, 2024
2 parents e9d94b1 + d31979b commit c7086f7
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 c7086f7

Please sign in to comment.