Skip to content

Commit 8647f7f

Browse files
committed
Fix v2 tests that directly link Loader which statically link
Signed-off-by: Neil R. Spruit <neil.r.spruit@intel.com>
1 parent 2765372 commit 8647f7f

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

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)