Skip to content

Commit 198a23e

Browse files
idubinovAlexeySachkovdm-vodopyanov
authored
[SYCL][L0] Fix absence of zeInit in Level Zero LIT e2e tests (#18956)
Co-authored-by: Alexey Sachkov <[email protected]> Co-authored-by: Dmitry Vodopyanov <[email protected]>
1 parent 8128c0c commit 198a23e

24 files changed

+124
-52
lines changed

sycl/test-e2e/Adapters/level_zero/batch_barrier.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@ int main(int argc, char *argv[]) {
2727
// CHECK: ---> urEnqueueKernelLaunch
2828
// CHECK-NOT: zeCommandQueueExecuteCommandLists
2929

30-
// Initialize Level Zero driver is required if this test is linked
31-
// statically with Level Zero loader, the driver will not be init otherwise.
30+
// Initializing Level Zero driver is required if this test is linked
31+
// statically with Level Zero loader, otherwise the driver will not be
32+
// initialized.
3233
ze_result_t result = zeInit(ZE_INIT_FLAG_GPU_ONLY);
3334
if (result != ZE_RESULT_SUCCESS) {
34-
std::cout << "zeInit failed\n";
35+
std::cout << "zeInit failed with error code: " << result << std::endl;
3536
return 1;
3637
}
3738

sycl/test-e2e/Adapters/level_zero/interop-buffer-multi-dim.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@ int main() {
2525
return 0;
2626
}
2727

28-
// Initialize Level Zero driver is required if this test is linked
29-
// statically with Level Zero loader, the driver will not be init otherwise.
28+
// Initializing Level Zero driver is required if this test is linked
29+
// statically with Level Zero loader, otherwise the driver will not be
30+
// initialized.
3031
ze_result_t result = zeInit(ZE_INIT_FLAG_GPU_ONLY);
3132
if (result != ZE_RESULT_SUCCESS) {
32-
std::cout << "zeInit failed\n";
33+
std::cout << "zeInit failed with error code: " << result << std::endl;
3334
return 1;
3435
}
3536

sycl/test-e2e/Adapters/level_zero/interop-buffer-ownership.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,12 @@ int main() {
127127
return 0;
128128
}
129129

130-
// Initialize Level Zero driver is required if this test is linked
131-
// statically with Level Zero loader, the driver will not be init otherwise.
130+
// Initializing Level Zero driver is required if this test is linked
131+
// statically with Level Zero loader, otherwise the driver will not be
132+
// initialized.
132133
ze_result_t result = zeInit(ZE_INIT_FLAG_GPU_ONLY);
133134
if (result != ZE_RESULT_SUCCESS) {
134-
std::cout << "zeInit failed\n";
135+
std::cout << "zeInit failed with error code: " << result << std::endl;
135136
return 1;
136137
}
137138

sycl/test-e2e/Adapters/level_zero/interop-buffer.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,11 @@ int main() {
4545
auto ZeContext = get_native<backend::ext_oneapi_level_zero>(Context);
4646
auto ZeDevice = get_native<backend::ext_oneapi_level_zero>(Device);
4747

48-
// Initialize Level Zero driver is required if this test is linked
49-
// statically with Level Zero loader, the driver will not be init otherwise.
48+
// Initializing Level Zero driver is required if this test is linked
49+
// statically with Level Zero loader, otherwise the driver will not be
50+
// initialized.
5051
ze_result_t result = zeInit(ZE_INIT_FLAG_GPU_ONLY);
51-
if (result != ZE_RESULT_SUCCESS) {
52-
std::cout << "zeInit failed\n";
53-
return 1;
54-
}
52+
assert(result == ZE_RESULT_SUCCESS);
5553

5654
ze_host_mem_alloc_desc_t HostDesc = {};
5755
HostDesc.stype = ZE_STRUCTURE_TYPE_HOST_MEM_ALLOC_DESC;

sycl/test-e2e/Adapters/level_zero/interop-direct.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ int main() {
2323
// Init L0
2424
ze_result_t result = zeInit(0);
2525
if (result != ZE_RESULT_SUCCESS) {
26-
std::cout << "zeInit failed\n";
26+
std::cout << "zeInit failed with error code: " << result << std::endl;
2727
return 1;
2828
}
2929

sycl/test-e2e/Adapters/level_zero/interop-get-native-mem.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,12 @@ int main() {
3434
return 0;
3535
}
3636

37-
// Initialize Level Zero driver is required if this test is linked
38-
// statically with Level Zero loader, the driver will not be init otherwise.
37+
// Initializing Level Zero driver is required if this test is linked
38+
// statically with Level Zero loader, otherwise the driver will not be
39+
// initialized.
3940
ze_result_t result = zeInit(ZE_INIT_FLAG_GPU_ONLY);
4041
if (result != ZE_RESULT_SUCCESS) {
41-
std::cout << "zeInit failed\n";
42+
std::cout << "zeInit failed with error code: " << result << std::endl;
4243
return 1;
4344
}
4445

sycl/test-e2e/Adapters/level_zero/interop-image-get-native-mem.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,12 @@ int main() {
4646
sycl::device D =
4747
sycl::ext::oneapi::filter_selector("level_zero:gpu").select_device();
4848

49-
// Initialize Level Zero driver is required if this test is linked
50-
// statically with Level Zero loader, the driver will not be init otherwise.
49+
// Initializing Level Zero driver is required if this test is linked
50+
// statically with Level Zero loader, otherwise the driver will not be
51+
// initialized.
5152
ze_result_t result = zeInit(ZE_INIT_FLAG_GPU_ONLY);
5253
if (result != ZE_RESULT_SUCCESS) {
53-
std::cout << "zeInit failed\n";
54+
std::cout << "zeInit failed with error code: " << result << std::endl;
5455
return 1;
5556
}
5657

sycl/test-e2e/Adapters/level_zero/interop-image-ownership.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,12 @@ int main() {
146146
#ifdef SYCL_EXT_ONEAPI_BACKEND_LEVEL_ZERO
147147
platform Plt{gpu_selector_v};
148148

149-
// Initialize Level Zero driver is required if this test is linked
150-
// statically with Level Zero loader, the driver will not be init otherwise.
149+
// Initializing Level Zero driver is required if this test is linked
150+
// statically with Level Zero loader, otherwise the driver will not be
151+
// initialized.
151152
ze_result_t result = zeInit(ZE_INIT_FLAG_GPU_ONLY);
152153
if (result != ZE_RESULT_SUCCESS) {
153-
std::cout << "zeInit failed\n";
154+
std::cout << "zeInit failed with error code: " << result << std::endl;
154155
return 1;
155156
}
156157

sycl/test-e2e/Adapters/level_zero/interop-image.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,12 @@ int main() {
3838

3939
auto Devices = Plt.get_devices();
4040

41-
// Initialize Level Zero driver is required if this test is linked
42-
// statically with Level Zero loader, the driver will not be init otherwise.
41+
// Initializing Level Zero driver is required if this test is linked
42+
// statically with Level Zero loader, otherwise the driver will not be
43+
// initialized.
4344
ze_result_t result = zeInit(ZE_INIT_FLAG_GPU_ONLY);
4445
if (result != ZE_RESULT_SUCCESS) {
45-
std::cout << "zeInit failed\n";
46+
std::cout << "zeInit failed with error code: " << result << std::endl;
4647
return 1;
4748
}
4849

sycl/test-e2e/Adapters/level_zero/interop-keep-ownership.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@ int main() {
1818
device Device(gpu_selector_v);
1919
platform Platform = Device.get_info<info::device::platform>();
2020

21-
// Initialize Level Zero driver is required if this test is linked
22-
// statically with Level Zero loader, the driver will not be init otherwise.
21+
// Initializing Level Zero driver is required if this test is linked
22+
// statically with Level Zero loader, otherwise the driver will not be
23+
// initialized.
2324
ze_result_t result = zeInit(ZE_INIT_FLAG_GPU_ONLY);
2425
if (result != ZE_RESULT_SUCCESS) {
25-
std::cout << "zeInit failed\n";
26+
std::cout << "zeInit failed with error code: " << result << std::endl;
2627
return 1;
2728
}
2829

0 commit comments

Comments
 (0)