Return all devices from helper function in bbox tests

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2021-03-18 22:23:24 +00:00
committed by Compute-Runtime-Automation
parent 0d82a894e7
commit d264dc858f
12 changed files with 31 additions and 18 deletions

View File

@@ -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<ze_device_handle_t> 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<ze_device_handle_t> 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<ze_device_handle_t> zelloInitContextAndGetDevices(ze_context_handle_t &context) {
ze_driver_handle_t driverHandle;
return zelloInitContextAndGetDevices(context, driverHandle);
}

View File

@@ -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 = {};

View File

@@ -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"

View File

@@ -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 = {};

View File

@@ -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));

View File

@@ -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));

View File

@@ -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 = {};

View File

@@ -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 &currentTest) {
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));

View File

@@ -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/";

View File

@@ -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 = {};

View File

@@ -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 = {};

View File

@@ -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));