From d128fea964b66c9e553f28183558968a12108d7b Mon Sep 17 00:00:00 2001 From: John Kesapides <46718829+JohnKesapidesARM@users.noreply.github.com> Date: Thu, 26 Mar 2020 22:14:46 +0000 Subject: [PATCH] Global variable gDeviceType correctly set (#611) Add gDeviceType set on kernel_read_write tests(image_streams) as the device type affects the way validation is performed in the test. Signed-off-by: John Kesapides --- test_common/harness/testHarness.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test_common/harness/testHarness.cpp b/test_common/harness/testHarness.cpp index 1bb607a5..c81acc2d 100644 --- a/test_common/harness/testHarness.cpp +++ b/test_common/harness/testHarness.cpp @@ -253,7 +253,7 @@ int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_def } } - gDeviceType = device_type; + switch (device_type) { @@ -344,6 +344,13 @@ int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_def device = devices[choosen_device_index]; + err = clGetDeviceInfo( device, CL_DEVICE_TYPE, sizeof(gDeviceType), &gDeviceType, NULL ); + if( err ) + { + print_error( err, "Unable to get device type" ); + return TEST_FAIL; + } + if( printDeviceHeader( device ) != CL_SUCCESS ) { return EXIT_FAILURE;