mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 14:02:58 +08:00
Return all devices from helper function in bbox tests
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
0d82a894e7
commit
d264dc858f
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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 = {};
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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 = {};
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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 = {};
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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/";
|
||||
|
||||
@@ -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 = {};
|
||||
|
||||
@@ -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 = {};
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user