diff --git a/sycl/test-e2e/Adapters/level_zero/batch_barrier.cpp b/sycl/test-e2e/Adapters/level_zero/batch_barrier.cpp index 88a51f579dc0b..d7993cad569f6 100644 --- a/sycl/test-e2e/Adapters/level_zero/batch_barrier.cpp +++ b/sycl/test-e2e/Adapters/level_zero/batch_barrier.cpp @@ -27,11 +27,12 @@ int main(int argc, char *argv[]) { // CHECK: ---> urEnqueueKernelLaunch // CHECK-NOT: zeCommandQueueExecuteCommandLists - // Initialize Level Zero driver is required if this test is linked - // statically with Level Zero loader, the driver will not be init otherwise. + // Initializing Level Zero driver is required if this test is linked + // statically with Level Zero loader, otherwise the driver will not be + // initialized. ze_result_t result = zeInit(ZE_INIT_FLAG_GPU_ONLY); if (result != ZE_RESULT_SUCCESS) { - std::cout << "zeInit failed\n"; + std::cout << "zeInit failed" << std::endl; return 1; } diff --git a/sycl/test-e2e/Adapters/level_zero/interop-buffer-multi-dim.cpp b/sycl/test-e2e/Adapters/level_zero/interop-buffer-multi-dim.cpp index 73c8a04d2f88f..037d218853951 100644 --- a/sycl/test-e2e/Adapters/level_zero/interop-buffer-multi-dim.cpp +++ b/sycl/test-e2e/Adapters/level_zero/interop-buffer-multi-dim.cpp @@ -25,11 +25,12 @@ int main() { return 0; } - // Initialize Level Zero driver is required if this test is linked - // statically with Level Zero loader, the driver will not be init otherwise. + // Initializing Level Zero driver is required if this test is linked + // statically with Level Zero loader, otherwise the driver will not be + // initialized. ze_result_t result = zeInit(ZE_INIT_FLAG_GPU_ONLY); if (result != ZE_RESULT_SUCCESS) { - std::cout << "zeInit failed\n"; + std::cout << "zeInit failed" << std::endl; return 1; } diff --git a/sycl/test-e2e/Adapters/level_zero/interop-buffer-ownership.cpp b/sycl/test-e2e/Adapters/level_zero/interop-buffer-ownership.cpp index d94e8e5dab05d..bc121fdda7838 100644 --- a/sycl/test-e2e/Adapters/level_zero/interop-buffer-ownership.cpp +++ b/sycl/test-e2e/Adapters/level_zero/interop-buffer-ownership.cpp @@ -127,11 +127,12 @@ int main() { return 0; } - // Initialize Level Zero driver is required if this test is linked - // statically with Level Zero loader, the driver will not be init otherwise. + // Initializing Level Zero driver is required if this test is linked + // statically with Level Zero loader, otherwise the driver will not be + // initialized. ze_result_t result = zeInit(ZE_INIT_FLAG_GPU_ONLY); if (result != ZE_RESULT_SUCCESS) { - std::cout << "zeInit failed\n"; + std::cout << "zeInit failed" << std::endl; return 1; } diff --git a/sycl/test-e2e/Adapters/level_zero/interop-buffer.cpp b/sycl/test-e2e/Adapters/level_zero/interop-buffer.cpp index 8f824ed113ca8..5bfed40013b0b 100644 --- a/sycl/test-e2e/Adapters/level_zero/interop-buffer.cpp +++ b/sycl/test-e2e/Adapters/level_zero/interop-buffer.cpp @@ -45,13 +45,11 @@ int main() { auto ZeContext = get_native(Context); auto ZeDevice = get_native(Device); - // Initialize Level Zero driver is required if this test is linked - // statically with Level Zero loader, the driver will not be init otherwise. + // Initializing Level Zero driver is required if this test is linked + // statically with Level Zero loader, otherwise the driver will not be + // initialized. ze_result_t result = zeInit(ZE_INIT_FLAG_GPU_ONLY); - if (result != ZE_RESULT_SUCCESS) { - std::cout << "zeInit failed\n"; - return 1; - } + assert(result == ZE_RESULT_SUCCESS); ze_host_mem_alloc_desc_t HostDesc = {}; HostDesc.stype = ZE_STRUCTURE_TYPE_HOST_MEM_ALLOC_DESC; diff --git a/sycl/test-e2e/Adapters/level_zero/interop-direct.cpp b/sycl/test-e2e/Adapters/level_zero/interop-direct.cpp index 8c88e559789d5..01006b7a7b694 100644 --- a/sycl/test-e2e/Adapters/level_zero/interop-direct.cpp +++ b/sycl/test-e2e/Adapters/level_zero/interop-direct.cpp @@ -23,7 +23,7 @@ int main() { // Init L0 ze_result_t result = zeInit(0); if (result != ZE_RESULT_SUCCESS) { - std::cout << "zeInit failed\n"; + std::cout << "zeInit failed" << std::endl; return 1; } diff --git a/sycl/test-e2e/Adapters/level_zero/interop-get-native-mem.cpp b/sycl/test-e2e/Adapters/level_zero/interop-get-native-mem.cpp index d5c945feed4c4..4dc0af896aebd 100644 --- a/sycl/test-e2e/Adapters/level_zero/interop-get-native-mem.cpp +++ b/sycl/test-e2e/Adapters/level_zero/interop-get-native-mem.cpp @@ -34,11 +34,12 @@ int main() { return 0; } - // Initialize Level Zero driver is required if this test is linked - // statically with Level Zero loader, the driver will not be init otherwise. + // Initializing Level Zero driver is required if this test is linked + // statically with Level Zero loader, otherwise the driver will not be + // initialized. ze_result_t result = zeInit(ZE_INIT_FLAG_GPU_ONLY); if (result != ZE_RESULT_SUCCESS) { - std::cout << "zeInit failed\n"; + std::cout << "zeInit failed" << std::endl; return 1; } diff --git a/sycl/test-e2e/Adapters/level_zero/interop-image-get-native-mem.cpp b/sycl/test-e2e/Adapters/level_zero/interop-image-get-native-mem.cpp index b6a48138c66d8..25d5d8f839742 100644 --- a/sycl/test-e2e/Adapters/level_zero/interop-image-get-native-mem.cpp +++ b/sycl/test-e2e/Adapters/level_zero/interop-image-get-native-mem.cpp @@ -46,11 +46,12 @@ int main() { sycl::device D = sycl::ext::oneapi::filter_selector("level_zero:gpu").select_device(); - // Initialize Level Zero driver is required if this test is linked - // statically with Level Zero loader, the driver will not be init otherwise. + // Initializing Level Zero driver is required if this test is linked + // statically with Level Zero loader, otherwise the driver will not be + // initialized. ze_result_t result = zeInit(ZE_INIT_FLAG_GPU_ONLY); if (result != ZE_RESULT_SUCCESS) { - std::cout << "zeInit failed\n"; + std::cout << "zeInit failed" << std::endl; return 1; } diff --git a/sycl/test-e2e/Adapters/level_zero/interop-image-ownership.cpp b/sycl/test-e2e/Adapters/level_zero/interop-image-ownership.cpp index 5a81e10f13b41..1b04e0bcd157f 100644 --- a/sycl/test-e2e/Adapters/level_zero/interop-image-ownership.cpp +++ b/sycl/test-e2e/Adapters/level_zero/interop-image-ownership.cpp @@ -146,11 +146,12 @@ int main() { #ifdef SYCL_EXT_ONEAPI_BACKEND_LEVEL_ZERO platform Plt{gpu_selector_v}; - // Initialize Level Zero driver is required if this test is linked - // statically with Level Zero loader, the driver will not be init otherwise. + // Initializing Level Zero driver is required if this test is linked + // statically with Level Zero loader, otherwise the driver will not be + // initialized. ze_result_t result = zeInit(ZE_INIT_FLAG_GPU_ONLY); if (result != ZE_RESULT_SUCCESS) { - std::cout << "zeInit failed\n"; + std::cout << "zeInit failed" << std::endl; return 1; } diff --git a/sycl/test-e2e/Adapters/level_zero/interop-image.cpp b/sycl/test-e2e/Adapters/level_zero/interop-image.cpp index 2e811d155af24..03d9eb8083b67 100644 --- a/sycl/test-e2e/Adapters/level_zero/interop-image.cpp +++ b/sycl/test-e2e/Adapters/level_zero/interop-image.cpp @@ -38,11 +38,12 @@ int main() { auto Devices = Plt.get_devices(); - // Initialize Level Zero driver is required if this test is linked - // statically with Level Zero loader, the driver will not be init otherwise. + // Initializing Level Zero driver is required if this test is linked + // statically with Level Zero loader, otherwise the driver will not be + // initialized. ze_result_t result = zeInit(ZE_INIT_FLAG_GPU_ONLY); if (result != ZE_RESULT_SUCCESS) { - std::cout << "zeInit failed\n"; + std::cout << "zeInit failed" << std::endl; return 1; } diff --git a/sycl/test-e2e/Adapters/level_zero/interop-keep-ownership.cpp b/sycl/test-e2e/Adapters/level_zero/interop-keep-ownership.cpp index d3d002ab0ed0d..d225af57c0607 100644 --- a/sycl/test-e2e/Adapters/level_zero/interop-keep-ownership.cpp +++ b/sycl/test-e2e/Adapters/level_zero/interop-keep-ownership.cpp @@ -18,11 +18,12 @@ int main() { device Device(gpu_selector_v); platform Platform = Device.get_info(); - // Initialize Level Zero driver is required if this test is linked - // statically with Level Zero loader, the driver will not be init otherwise. + // Initializing Level Zero driver is required if this test is linked + // statically with Level Zero loader, otherwise the driver will not be + // initialized. ze_result_t result = zeInit(ZE_INIT_FLAG_GPU_ONLY); if (result != ZE_RESULT_SUCCESS) { - std::cout << "zeInit failed\n"; + std::cout << "zeInit failed" << std::endl; return 1; } diff --git a/sycl/test-e2e/Adapters/level_zero/interop-thread.cpp b/sycl/test-e2e/Adapters/level_zero/interop-thread.cpp index cd9eb04b21ae4..c3a7146a7a59f 100644 --- a/sycl/test-e2e/Adapters/level_zero/interop-thread.cpp +++ b/sycl/test-e2e/Adapters/level_zero/interop-thread.cpp @@ -61,7 +61,11 @@ ze_event_pool_handle_t event_pool = {}; std::vector old_ops; void init() { - zeInit(0); + // Initializing Level Zero driver is required if this test is linked + // statically with Level Zero loader, otherwise the driver will not be + // initialized. + ze_result_t result = zeInit(0); + assert(result == ZE_RESULT_SUCCESS); uint32_t driverCount = 0; assert(zeDriverGet(&driverCount, nullptr) == 0); diff --git a/sycl/test-e2e/Adapters/level_zero/interop.cpp b/sycl/test-e2e/Adapters/level_zero/interop.cpp index 204823dd5e80b..b37b3f7b9b1ad 100644 --- a/sycl/test-e2e/Adapters/level_zero/interop.cpp +++ b/sycl/test-e2e/Adapters/level_zero/interop.cpp @@ -16,11 +16,12 @@ using namespace sycl; int main() { #ifdef SYCL_EXT_ONEAPI_BACKEND_LEVEL_ZERO - // Initialize Level Zero driver is required if this test is linked - // statically with Level Zero loader, the driver will not be init otherwise. + // Initializing Level Zero driver is required if this test is linked + // statically with Level Zero loader, otherwise the driver will not be + // initialized. ze_result_t result = zeInit(ZE_INIT_FLAG_GPU_ONLY); if (result != ZE_RESULT_SUCCESS) { - std::cout << "zeInit failed\n"; + std::cout << "zeInit failed" << std::endl; return 1; } diff --git a/sycl/test-e2e/Adapters/level_zero/uuid.cpp b/sycl/test-e2e/Adapters/level_zero/uuid.cpp index 6f79a6f54ecdb..92ac55ab2918b 100644 --- a/sycl/test-e2e/Adapters/level_zero/uuid.cpp +++ b/sycl/test-e2e/Adapters/level_zero/uuid.cpp @@ -24,6 +24,16 @@ int main() { auto zedev = sycl::get_native(dev); ze_device_properties_t device_properties{}; device_properties.stype = ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES; + + // Initializing Level Zero driver is required if this test is linked + // statically with Level Zero loader, otherwise the driver will not be + // initialized. + ze_result_t result = zeInit(ZE_INIT_FLAG_GPU_ONLY); + if (result != ZE_RESULT_SUCCESS) { + std::cout << "zeInit failed" << std::endl; + return 1; + } + zeDeviceGetProperties(zedev, &device_properties); std::stringstream uuid_l0; for (int i = 0; i < ZE_MAX_DEVICE_UUID_SIZE; ++i) diff --git a/sycl/test-e2e/AtomicRef/device_has_aspect_atomic64_level_zero.cpp b/sycl/test-e2e/AtomicRef/device_has_aspect_atomic64_level_zero.cpp index 1b62406094128..93f080fdd972c 100644 --- a/sycl/test-e2e/AtomicRef/device_has_aspect_atomic64_level_zero.cpp +++ b/sycl/test-e2e/AtomicRef/device_has_aspect_atomic64_level_zero.cpp @@ -9,6 +9,12 @@ using namespace sycl; int main() { + // Initializing Level Zero driver is required if this test is linked + // statically with Level Zero loader, otherwise the driver will not be + // initialized. + ze_result_t result = zeInit(ZE_INIT_FLAG_GPU_ONLY); + assert(result == ZE_RESULT_SUCCESS && "zeInit failed"); + queue Queue; device Dev = Queue.get_device(); bool Result; diff --git a/sycl/test-e2e/Basic/buffer/buffer_create.cpp b/sycl/test-e2e/Basic/buffer/buffer_create.cpp index 286241eeb0627..4baa25f02c4a7 100644 --- a/sycl/test-e2e/Basic/buffer/buffer_create.cpp +++ b/sycl/test-e2e/Basic/buffer/buffer_create.cpp @@ -11,6 +11,15 @@ using namespace sycl; int main() { + // Initializing Level Zero driver is required if this test is linked + // statically with Level Zero loader, otherwise the driver will not be + // initialized. + ze_result_t result = zeInit(0); + if (result != ZE_RESULT_SUCCESS) { + std::cout << "zeInit failed" << std::endl; + return 1; + } + constexpr int Size = 100; queue Queue; auto D = Queue.get_device(); diff --git a/sycl/test-e2e/Basic/interop/get_native_ze.cpp b/sycl/test-e2e/Basic/interop/get_native_ze.cpp index fed3afc6f29b0..87b9145f49abd 100644 --- a/sycl/test-e2e/Basic/interop/get_native_ze.cpp +++ b/sycl/test-e2e/Basic/interop/get_native_ze.cpp @@ -12,11 +12,12 @@ constexpr auto BE = sycl::backend::ext_oneapi_level_zero; class TestKernel; int main() { - // Initialize Level Zero driver is required if this test is linked - // statically with Level Zero loader, the driver will not be init otherwise. + // Initializing Level Zero driver is required if this test is linked + // statically with Level Zero loader, otherwise the driver will not be + // initialized. ze_result_t result = zeInit(ZE_INIT_FLAG_GPU_ONLY); if (result != ZE_RESULT_SUCCESS) { - std::cout << "zeInit failed\n"; + std::cout << "zeInit failed" << std::endl; return 1; } diff --git a/sycl/test-e2e/Basic/interop/make_kernel_subdevice_l0.cpp b/sycl/test-e2e/Basic/interop/make_kernel_subdevice_l0.cpp index 20a56f894dbcf..12b4140429186 100644 --- a/sycl/test-e2e/Basic/interop/make_kernel_subdevice_l0.cpp +++ b/sycl/test-e2e/Basic/interop/make_kernel_subdevice_l0.cpp @@ -93,6 +93,15 @@ ze_kernel_handle_t create_kernel(ze_module_handle_t module, } int main() { + // Initializing Level Zero driver is required if this test is linked + // statically with Level Zero loader, otherwise the driver will not be + // initialized. + ze_result_t result = zeInit(ZE_INIT_FLAG_GPU_ONLY); + if (result != ZE_RESULT_SUCCESS) { + std::cout << "zeInit failed" << std::endl; + return 1; + } + device D{gpu_selector_v}; try { diff --git a/sycl/test-e2e/Basic/interop/ze_context_device.cpp b/sycl/test-e2e/Basic/interop/ze_context_device.cpp index 9dd34e93ba54d..33866c6616bb9 100644 --- a/sycl/test-e2e/Basic/interop/ze_context_device.cpp +++ b/sycl/test-e2e/Basic/interop/ze_context_device.cpp @@ -17,7 +17,9 @@ int main(int argc, char *argv[]) { int level0DriverIndex = 0; int level0DeviceIndex = 0; - zeInit(0); + ze_result_t result = zeInit(0); + assert(result == ZE_RESULT_SUCCESS); + uint32_t level0NumDrivers = 0; zeDriverGet(&level0NumDrivers, nullptr); diff --git a/sycl/test-e2e/DeviceImageBackendContent/L0_interop_test.cpp b/sycl/test-e2e/DeviceImageBackendContent/L0_interop_test.cpp index 20dc8ee79e0f4..b5b550e8d6c36 100644 --- a/sycl/test-e2e/DeviceImageBackendContent/L0_interop_test.cpp +++ b/sycl/test-e2e/DeviceImageBackendContent/L0_interop_test.cpp @@ -20,6 +20,12 @@ extern "C" SYCL_EXT_ONEAPI_FUNCTION_PROPERTY( } int main() { + // Initializing Level Zero driver is required if this test is linked + // statically with Level Zero loader, otherwise the driver will not be + // initialized. + ze_result_t result = zeInit(ZE_INIT_FLAG_GPU_ONLY); + assert(result == ZE_RESULT_SUCCESS); + sycl::queue q; sycl::context ctxt = q.get_context(); sycl::device d = ctxt.get_devices()[0]; diff --git a/sycl/test-e2e/Graph/Inputs/interop-level-zero-get-native-mem.cpp b/sycl/test-e2e/Graph/Inputs/interop-level-zero-get-native-mem.cpp index 641deaf4b0165..aa138556b9405 100644 --- a/sycl/test-e2e/Graph/Inputs/interop-level-zero-get-native-mem.cpp +++ b/sycl/test-e2e/Graph/Inputs/interop-level-zero-get-native-mem.cpp @@ -21,11 +21,12 @@ bool is_discrete(const device &Device) { } int main() { - // Initialize Level Zero driver is required if this test is linked - // statically with Level Zero loader, the driver will not be init otherwise. + // Initializing Level Zero driver is required if this test is linked + // statically with Level Zero loader, otherwise the driver will not be + // initialized. ze_result_t result = zeInit(ZE_INIT_FLAG_GPU_ONLY); if (result != ZE_RESULT_SUCCESS) { - std::cout << "zeInit failed\n"; + std::cout << "zeInit failed" << std::endl; return 1; } diff --git a/sycl/test-e2e/Graph/Inputs/interop-level-zero-launch-kernel.cpp b/sycl/test-e2e/Graph/Inputs/interop-level-zero-launch-kernel.cpp index 94fdff8ef66dc..3748b2265f76a 100644 --- a/sycl/test-e2e/Graph/Inputs/interop-level-zero-launch-kernel.cpp +++ b/sycl/test-e2e/Graph/Inputs/interop-level-zero-launch-kernel.cpp @@ -43,11 +43,12 @@ int main(int, char **argv) { return 0; } - // Initialize Level Zero driver is required if this test is linked - // statically with Level Zero loader, the driver will not be init otherwise. + // Initializing Level Zero driver is required if this test is linked + // statically with Level Zero loader, otherwise the driver will not be + // initialized. ze_result_t result = zeInit(ZE_INIT_FLAG_GPU_ONLY); if (result != ZE_RESULT_SUCCESS) { - std::cout << "zeInit failed\n"; + std::cout << "zeInit failed" << std::endl; return 1; } diff --git a/sycl/test-e2e/Graph/NativeCommand/level-zero_usm.cpp b/sycl/test-e2e/Graph/NativeCommand/level-zero_usm.cpp index 1bd18d5dd81ca..4a947757a75a1 100644 --- a/sycl/test-e2e/Graph/NativeCommand/level-zero_usm.cpp +++ b/sycl/test-e2e/Graph/NativeCommand/level-zero_usm.cpp @@ -17,11 +17,12 @@ namespace exp_ext = sycl::ext::oneapi::experimental; using namespace sycl; int main() { - // Initialize Level Zero driver is required if this test is linked - // statically with Level Zero loader, the driver will not be init otherwise. + // Initializing Level Zero driver is required if this test is linked + // statically with Level Zero loader, otherwise the driver will not be + // initialized. ze_result_t result = zeInit(ZE_INIT_FLAG_GPU_ONLY); if (result != ZE_RESULT_SUCCESS) { - std::cout << "zeInit failed\n"; + std::cout << "zeInit failed" << std::endl; return 1; } diff --git a/sycl/test-e2e/Graph/NativeCommand/level-zero_usm_D2H_copy.cpp b/sycl/test-e2e/Graph/NativeCommand/level-zero_usm_D2H_copy.cpp index 505faecbb9a76..f04d9d821b46d 100644 --- a/sycl/test-e2e/Graph/NativeCommand/level-zero_usm_D2H_copy.cpp +++ b/sycl/test-e2e/Graph/NativeCommand/level-zero_usm_D2H_copy.cpp @@ -24,11 +24,12 @@ namespace exp_ext = sycl::ext::oneapi::experimental; using namespace sycl; int main() { - // Initialize Level Zero driver is required if this test is linked - // statically with Level Zero loader, the driver will not be init otherwise. + // Initializing Level Zero driver is required if this test is linked + // statically with Level Zero loader, otherwise the driver will not be + // initialized. ze_result_t result = zeInit(ZE_INIT_FLAG_GPU_ONLY); if (result != ZE_RESULT_SUCCESS) { - std::cout << "zeInit failed\n"; + std::cout << "zeInit failed" << std::endl; return 1; } diff --git a/sycl/test-e2e/Regression/cache_test.cpp b/sycl/test-e2e/Regression/cache_test.cpp index 52cfa069f6129..ffdd80f5a9607 100644 --- a/sycl/test-e2e/Regression/cache_test.cpp +++ b/sycl/test-e2e/Regression/cache_test.cpp @@ -151,6 +151,15 @@ int queryFromNativeHandle(std::vector *platform_list, } int main() { + // Initializing Level Zero driver is required if this test is linked + // statically with Level Zero loader, otherwise the driver will not be + // initialized. + ze_result_t result = zeInit(ZE_INIT_FLAG_GPU_ONLY); + if (result != ZE_RESULT_SUCCESS) { + std::cout << "zeInit failed" << std::endl; + return 1; + } + int failures = 0; // Query for a list of all of the available platforms and devices.