Device enqueue optional (#579)

* optional execution of device side enqueue

* make device enqueue test suite optional
This commit is contained in:
boazo
2020-02-20 21:38:23 +02:00
committed by GitHub
parent 5cc6bf8237
commit 7d8dcbe678

View File

@@ -28,8 +28,29 @@
std::string gKernelName; std::string gKernelName;
int gWimpyMode = 0; int gWimpyMode = 0;
test_status InitCL(cl_device_id device) {
auto version = get_device_cl_version(device);
if (version < Version(2, 0)) {
return TEST_SKIP;
}
int error;
cl_uint max_queues_size;
error = clGetDeviceInfo(device, CL_DEVICE_MAX_ON_DEVICE_QUEUES,
sizeof(max_queues_size), &max_queues_size, NULL);
if (error != CL_SUCCESS) {
print_error(error, "Unable to get max queues on device");
return TEST_FAIL;
}
if ((max_queues_size == 0) && (version > Version(2,2))) {
return TEST_SKIP;
}
return TEST_PASS;
}
test_definition test_list[] = { test_definition test_list[] = {
#ifdef CL_VERSION_2_0
ADD_TEST( device_info ), ADD_TEST( device_info ),
ADD_TEST( device_queue ), ADD_TEST( device_queue ),
ADD_TEST( execute_block ), ADD_TEST( execute_block ),
@@ -41,7 +62,6 @@ test_definition test_list[] = {
ADD_TEST( host_multi_queue ), ADD_TEST( host_multi_queue ),
ADD_TEST( enqueue_ndrange ), ADD_TEST( enqueue_ndrange ),
ADD_TEST( host_queue_order ), ADD_TEST( host_queue_order ),
#endif
}; };
const int test_num = ARRAY_SIZE( test_list ); const int test_num = ARRAY_SIZE( test_list );
@@ -76,5 +96,5 @@ int main(int argc, const char *argv[])
} }
} }
return runTestHarnessWithCheck(argc, argv, test_num, test_list, false, false, 0, NULL); return runTestHarnessWithCheck(argc, argv, test_num, test_list, false, false, 0, InitCL);
} }