Skip to content

Commit

Permalink
[L0] Fix provider native error reporting
Browse files Browse the repository at this point in the history
Level Zero provider internally stores native errors of ur_result_t type.
  • Loading branch information
kswiecicki committed Jan 21, 2025
1 parent 31cbee9 commit 51fec4f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion source/adapters/level_zero/usm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ 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));
// L0 provider stores native errors of ur_result_t type
return static_cast<ur_result_t>(nativeError);
}

return UR_RESULT_ERROR_UNKNOWN;
Expand Down
2 changes: 1 addition & 1 deletion source/adapters/level_zero/usm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class L0MemoryProvider : public USMMemoryProviderBase {
umf_result_t free(void *Ptr, size_t Size) override;
umf_result_t get_min_page_size(void *, size_t *) override;
// TODO: Different name for each provider (Host/Shared/SharedRO/Device)
const char *get_name() override { return "L0"; };
const char *get_name() override { return "Level Zero"; };
umf_result_t get_ipc_handle_size(size_t *) override;
umf_result_t get_ipc_handle(const void *, size_t, void *) override;
umf_result_t put_ipc_handle(void *) override;
Expand Down

0 comments on commit 51fec4f

Please sign in to comment.