From d264dc858f794351665bae01061d0b34de83b601 Mon Sep 17 00:00:00 2001 From: Mateusz Hoppe Date: Thu, 18 Mar 2021 22:23:24 +0000 Subject: [PATCH] Return all devices from helper function in bbox tests Signed-off-by: Mateusz Hoppe --- level_zero/core/test/black_box_tests/common/zello_common.h | 6 +++--- level_zero/core/test/black_box_tests/zello_copy.cpp | 5 +++-- level_zero/core/test/black_box_tests/zello_copy_fence.cpp | 4 ++-- level_zero/core/test/black_box_tests/zello_copy_image.cpp | 3 ++- level_zero/core/test/black_box_tests/zello_copy_only.cpp | 3 ++- level_zero/core/test/black_box_tests/zello_fence.cpp | 3 ++- level_zero/core/test/black_box_tests/zello_scratch.cpp | 3 ++- level_zero/core/test/black_box_tests/zello_timestamp.cpp | 5 +++-- .../test/black_box_tests/zello_world_global_work_offset.cpp | 4 +++- level_zero/core/test/black_box_tests/zello_world_gpu.cpp | 6 ++++-- .../core/test/black_box_tests/zello_world_jitc_ocloc.cpp | 4 +++- level_zero/core/test/black_box_tests/zello_world_usm.cpp | 3 ++- 12 files changed, 31 insertions(+), 18 deletions(-) diff --git a/level_zero/core/test/black_box_tests/common/zello_common.h b/level_zero/core/test/black_box_tests/common/zello_common.h index 682f922ea3..5a0494c084 100644 --- a/level_zero/core/test/black_box_tests/common/zello_common.h +++ b/level_zero/core/test/black_box_tests/common/zello_common.h @@ -142,7 +142,7 @@ ze_result_t createCommandList(ze_context_handle_t &context, ze_device_handle_t & return zeCommandListCreate(context, device, &descriptor, &cmdList); } -ze_device_handle_t zelloInitContextAndGetDevices(ze_context_handle_t &context, ze_driver_handle_t &driverHandle) { +std::vector zelloInitContextAndGetDevices(ze_context_handle_t &context, ze_driver_handle_t &driverHandle) { SUCCESS_OR_TERMINATE(zeInit(ZE_INIT_FLAG_GPU_ONLY)); uint32_t driverCount = 0; @@ -165,10 +165,10 @@ ze_device_handle_t zelloInitContextAndGetDevices(ze_context_handle_t &context, z } std::vector devices(deviceCount, nullptr); SUCCESS_OR_TERMINATE(zeDeviceGet(driverHandle, &deviceCount, devices.data())); - return devices[0]; + return devices; } -ze_device_handle_t zelloInitContextAndGetDevices(ze_context_handle_t &context) { +std::vector zelloInitContextAndGetDevices(ze_context_handle_t &context) { ze_driver_handle_t driverHandle; return zelloInitContextAndGetDevices(context, driverHandle); } diff --git a/level_zero/core/test/black_box_tests/zello_copy.cpp b/level_zero/core/test/black_box_tests/zello_copy.cpp index 3f4d80cb40..2d50b5f404 100644 --- a/level_zero/core/test/black_box_tests/zello_copy.cpp +++ b/level_zero/core/test/black_box_tests/zello_copy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation + * Copyright (C) 2020-2021 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -450,7 +450,8 @@ int main(int argc, char *argv[]) { verbose = isVerbose(argc, argv); ze_context_handle_t context = nullptr; - auto device = zelloInitContextAndGetDevices(context); + auto devices = zelloInitContextAndGetDevices(context); + auto device = devices[0]; bool outputValidationSuccessful = false; ze_device_properties_t deviceProperties = {}; diff --git a/level_zero/core/test/black_box_tests/zello_copy_fence.cpp b/level_zero/core/test/black_box_tests/zello_copy_fence.cpp index 4840b92c23..d07f2f9d45 100644 --- a/level_zero/core/test/black_box_tests/zello_copy_fence.cpp +++ b/level_zero/core/test/black_box_tests/zello_copy_fence.cpp @@ -91,8 +91,8 @@ int main(int argc, char *argv[]) { ze_context_handle_t context = nullptr; ze_driver_handle_t driverHandle = nullptr; - auto device = zelloInitContextAndGetDevices(context, driverHandle); - + auto devices = zelloInitContextAndGetDevices(context, driverHandle); + auto device = devices[0]; ze_device_properties_t deviceProperties = {}; SUCCESS_OR_TERMINATE(zeDeviceGetProperties(device, &deviceProperties)); std::cout << "Device : \n" diff --git a/level_zero/core/test/black_box_tests/zello_copy_image.cpp b/level_zero/core/test/black_box_tests/zello_copy_image.cpp index 496eb1f856..6a26e414df 100644 --- a/level_zero/core/test/black_box_tests/zello_copy_image.cpp +++ b/level_zero/core/test/black_box_tests/zello_copy_image.cpp @@ -110,7 +110,8 @@ void testAppendImageCopy(ze_context_handle_t &context, ze_device_handle_t &devic int main(int argc, char *argv[]) { verbose = isVerbose(argc, argv); ze_context_handle_t context = nullptr; - auto device = zelloInitContextAndGetDevices(context); + auto devices = zelloInitContextAndGetDevices(context); + auto device = devices[0]; bool outputValidationSuccessful; ze_device_properties_t deviceProperties = {}; diff --git a/level_zero/core/test/black_box_tests/zello_copy_only.cpp b/level_zero/core/test/black_box_tests/zello_copy_only.cpp index 73fea6499c..3d40bb7ad2 100644 --- a/level_zero/core/test/black_box_tests/zello_copy_only.cpp +++ b/level_zero/core/test/black_box_tests/zello_copy_only.cpp @@ -536,7 +536,8 @@ int main(int argc, char *argv[]) { verbose = isVerbose(argc, argv); ze_context_handle_t context = nullptr; ze_driver_handle_t driverHandle = nullptr; - auto device = zelloInitContextAndGetDevices(context, driverHandle); + auto devices = zelloInitContextAndGetDevices(context, driverHandle); + auto device = devices[0]; ze_device_properties_t deviceProperties = {}; SUCCESS_OR_TERMINATE(zeDeviceGetProperties(device, &deviceProperties)); diff --git a/level_zero/core/test/black_box_tests/zello_fence.cpp b/level_zero/core/test/black_box_tests/zello_fence.cpp index f9da3adcbb..25caf95c8f 100644 --- a/level_zero/core/test/black_box_tests/zello_fence.cpp +++ b/level_zero/core/test/black_box_tests/zello_fence.cpp @@ -194,7 +194,8 @@ int main(int argc, char *argv[]) { ze_context_handle_t context = nullptr; ze_driver_handle_t driverHandle = nullptr; - auto device = zelloInitContextAndGetDevices(context, driverHandle); + auto devices = zelloInitContextAndGetDevices(context, driverHandle); + auto device = devices[0]; ze_device_properties_t deviceProperties = {}; SUCCESS_OR_TERMINATE(zeDeviceGetProperties(device, &deviceProperties)); diff --git a/level_zero/core/test/black_box_tests/zello_scratch.cpp b/level_zero/core/test/black_box_tests/zello_scratch.cpp index 8e57b278ec..453390a07c 100644 --- a/level_zero/core/test/black_box_tests/zello_scratch.cpp +++ b/level_zero/core/test/black_box_tests/zello_scratch.cpp @@ -181,7 +181,8 @@ void executeGpuKernelAndValidate(ze_context_handle_t context, ze_device_handle_t int main(int argc, char *argv[]) { verbose = isVerbose(argc, argv); ze_context_handle_t context = nullptr; - auto device = zelloInitContextAndGetDevices(context); + auto devices = zelloInitContextAndGetDevices(context); + auto device = devices[0]; bool outputValidationSuccessful; ze_device_properties_t deviceProperties = {}; diff --git a/level_zero/core/test/black_box_tests/zello_timestamp.cpp b/level_zero/core/test/black_box_tests/zello_timestamp.cpp index 14891d8015..0b32bfd11c 100644 --- a/level_zero/core/test/black_box_tests/zello_timestamp.cpp +++ b/level_zero/core/test/black_box_tests/zello_timestamp.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation + * Copyright (C) 2020-2021 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -365,7 +365,8 @@ void printResult(bool result, std::string ¤tTest) { int main(int argc, char *argv[]) { verbose = isVerbose(argc, argv); ze_context_handle_t context = nullptr; - auto device = zelloInitContextAndGetDevices(context); + auto devices = zelloInitContextAndGetDevices(context); + auto device = devices[0]; ze_device_properties_t deviceProperties = {}; SUCCESS_OR_TERMINATE(zeDeviceGetProperties(device, &deviceProperties)); diff --git a/level_zero/core/test/black_box_tests/zello_world_global_work_offset.cpp b/level_zero/core/test/black_box_tests/zello_world_global_work_offset.cpp index 84b8ae0b0d..20cfda5e7a 100644 --- a/level_zero/core/test/black_box_tests/zello_world_global_work_offset.cpp +++ b/level_zero/core/test/black_box_tests/zello_world_global_work_offset.cpp @@ -252,7 +252,9 @@ int main(int argc, char *argv[]) { verbose = isVerbose(argc, argv); ze_driver_handle_t driverHandle; ze_context_handle_t context = nullptr; - auto device = zelloInitContextAndGetDevices(context, driverHandle); + auto devices = zelloInitContextAndGetDevices(context, driverHandle); + auto device = devices[0]; + bool outputValidationSuccessful; const char *defaultPath = "/usr/local/lib/"; diff --git a/level_zero/core/test/black_box_tests/zello_world_gpu.cpp b/level_zero/core/test/black_box_tests/zello_world_gpu.cpp index 5ae296fdc5..5905537d2f 100644 --- a/level_zero/core/test/black_box_tests/zello_world_gpu.cpp +++ b/level_zero/core/test/black_box_tests/zello_world_gpu.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation + * Copyright (C) 2020-2021 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -134,7 +134,9 @@ void executeGpuKernelAndValidate(ze_context_handle_t context, ze_device_handle_t int main(int argc, char *argv[]) { verbose = isVerbose(argc, argv); ze_context_handle_t context = nullptr; - auto device = zelloInitContextAndGetDevices(context); + auto devices = zelloInitContextAndGetDevices(context); + auto device = devices[0]; + bool outputValidationSuccessful; ze_device_properties_t deviceProperties = {}; diff --git a/level_zero/core/test/black_box_tests/zello_world_jitc_ocloc.cpp b/level_zero/core/test/black_box_tests/zello_world_jitc_ocloc.cpp index 4ef87646e0..d4783ab53e 100644 --- a/level_zero/core/test/black_box_tests/zello_world_jitc_ocloc.cpp +++ b/level_zero/core/test/black_box_tests/zello_world_jitc_ocloc.cpp @@ -146,7 +146,9 @@ void executeKernelAndValidate(ze_context_handle_t context, ze_device_handle_t &d int main(int argc, char *argv[]) { verbose = isVerbose(argc, argv); ze_context_handle_t context = nullptr; - auto device = zelloInitContextAndGetDevices(context); + auto devices = zelloInitContextAndGetDevices(context); + auto device = devices[0]; + bool outputValidationSuccessful; ze_device_properties_t deviceProperties = {}; diff --git a/level_zero/core/test/black_box_tests/zello_world_usm.cpp b/level_zero/core/test/black_box_tests/zello_world_usm.cpp index 18272fc7fa..90c0a61ee9 100644 --- a/level_zero/core/test/black_box_tests/zello_world_usm.cpp +++ b/level_zero/core/test/black_box_tests/zello_world_usm.cpp @@ -39,7 +39,8 @@ int main(int argc, char *argv[]) { ze_context_handle_t context = nullptr; ze_driver_handle_t driverHandle = nullptr; - auto device = zelloInitContextAndGetDevices(context, driverHandle); + auto devices = zelloInitContextAndGetDevices(context, driverHandle); + auto device = devices[0]; ze_device_properties_t deviceProperties = {}; SUCCESS_OR_TERMINATE(zeDeviceGetProperties(device, &deviceProperties));