Skip to content

Commit

Permalink
Fix urKernelCreateWithNativeHandle to properly init L0 before use
Browse files Browse the repository at this point in the history
Signed-off-by: Neil R. Spruit <[email protected]>
  • Loading branch information
nrspruit committed Feb 11, 2025
1 parent 49b0315 commit 59896f1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmake/FetchLevelZero.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ if (NOT DEFINED LEVEL_ZERO_LIBRARY OR NOT DEFINED LEVEL_ZERO_INCLUDE_DIR)
set(UR_LEVEL_ZERO_LOADER_REPO "https://github.com/nrspruit/level-zero.git")
endif()
if (UR_LEVEL_ZERO_LOADER_TAG STREQUAL "")
set(UR_LEVEL_ZERO_LOADER_TAG aec89b8c7244ce03306127a4c72ce554aaa19143)
set(UR_LEVEL_ZERO_LOADER_TAG 399cd159d00f08685f1a1281fec4ea732d8021cb)
endif()

# Disable due to a bug https://github.com/oneapi-src/level-zero/issues/104
Expand Down
6 changes: 5 additions & 1 deletion test/adapters/level_zero/urKernelCreateWithNativeHandle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ TEST_P(urLevelZeroKernelNativeHandleTest, OwnedHandleRelease) {

auto kernel_name =
uur::KernelsEnvironment::instance->GetEntryPointNames("foo")[0];

ze_init_driver_type_desc_t desc = {ZE_STRUCTURE_TYPE_INIT_DRIVER_TYPE_DESC};
desc.flags = ZE_INIT_DRIVER_TYPE_FLAG_GPU;
desc.pNext = nullptr;
uint32_t pCount = 0;
zeInitDrivers(&pCount, nullptr, &desc);
ze_module_desc_t moduleDesc{};
moduleDesc.stype = ZE_STRUCTURE_TYPE_MODULE_DESC;
moduleDesc.format = ZE_MODULE_FORMAT_IL_SPIRV;
Expand Down

0 comments on commit 59896f1

Please sign in to comment.