Skip to content

Commit 298eee4

Browse files
committed
Fix v2 tests that directly link Loader which statically link
Signed-off-by: Neil R. Spruit <[email protected]>
1 parent 2765372 commit 298eee4

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

cmake/FetchLevelZero.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ if (NOT DEFINED LEVEL_ZERO_LIBRARY OR NOT DEFINED LEVEL_ZERO_INCLUDE_DIR)
4343
set(UR_LEVEL_ZERO_LOADER_REPO "https://github.com/nrspruit/level-zero.git")
4444
endif()
4545
if (UR_LEVEL_ZERO_LOADER_TAG STREQUAL "")
46-
set(UR_LEVEL_ZERO_LOADER_TAG e0a776e0ff61c863e9440b01aa80f727f1dd96e3)
46+
set(UR_LEVEL_ZERO_LOADER_TAG a2ff82c2185534eaa3c042e8ce48fe45ef4555c3)
4747
endif()
4848

4949
# Disable due to a bug https://github.com/oneapi-src/level-zero/issues/104

test/adapters/level_zero/v2/command_list_cache_test.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,14 @@
1919
#include <unordered_set>
2020
#include <vector>
2121

22-
struct CommandListCacheTest : public uur::urContextTest {};
22+
struct CommandListCacheTest : public uur::urContextTest {
23+
void SetUp() override {
24+
// Initialize Level Zero driver is required if this test is linked statically with Level Zero loader, the driver will not be init otherwise.
25+
zeInit(ZE_INIT_FLAG_GPU_ONLY);
26+
urContextTest::SetUp();
27+
}
28+
29+
};
2330

2431
UUR_INSTANTIATE_DEVICE_TEST_SUITE(CommandListCacheTest);
2532

test/adapters/level_zero/v2/deferred_kernel.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
struct urEnqueueKernelLaunchTest : uur::urKernelExecutionTest {
1515
void SetUp() override {
16+
// Initialize Level Zero driver is required if this test is linked statically with Level Zero loader, the driver will not be init otherwise.
17+
zeInit(ZE_INIT_FLAG_GPU_ONLY);
1618
program_name = "fill";
1719
UUR_RETURN_ON_FATAL_FAILURE(urKernelExecutionTest::SetUp());
1820
}

test/adapters/level_zero/v2/event_pool_test.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ struct EventPoolTest : public uur::urQueueTestWithParam<ProviderParams> {
109109

110110
auto params = getParam();
111111

112+
// Initialize Level Zero driver is required if this test is linked statically with Level Zero loader, the driver will not be init otherwise.
113+
zeInit(ZE_INIT_FLAG_GPU_ONLY);
114+
112115
mockVec.push_back(device);
113116

114117
cache = std::unique_ptr<event_pool_cache>(new event_pool_cache(

0 commit comments

Comments
 (0)