Actual function execution
| 994 | |
| 995 | // Actual function execution |
| 996 | test_status callSingleTestFunction(test_definition test, |
| 997 | cl_device_id deviceToUse, |
| 998 | const test_harness_config &config) |
| 999 | { |
| 1000 | test_status status; |
| 1001 | cl_int error; |
| 1002 | cl_context context = NULL; |
| 1003 | cl_command_queue queue = NULL; |
| 1004 | |
| 1005 | log_info("%s...\n", test.name); |
| 1006 | fflush(stdout); |
| 1007 | |
| 1008 | const Version device_version = get_device_cl_version(deviceToUse); |
| 1009 | if (test.min_version > device_version) |
| 1010 | { |
| 1011 | version_expected_info(test.name, "OpenCL", |
| 1012 | test.min_version.to_string().c_str(), |
| 1013 | device_version.to_string().c_str()); |
| 1014 | return TEST_SKIP; |
| 1015 | } |
| 1016 | |
| 1017 | if (!check_functions_for_offline_compiler(test.name)) |
| 1018 | { |
| 1019 | log_info("Subtest %s tests is not supported in offline compiler " |
| 1020 | "execution path!\n", |
| 1021 | test.name); |
| 1022 | return TEST_SKIP; |
| 1023 | } |
| 1024 | |
| 1025 | /* Create a context to work with, unless we're told not to */ |
| 1026 | if (!config.forceNoContextCreation) |
| 1027 | { |
| 1028 | context = clCreateContext(NULL, 1, &deviceToUse, notify_callback, NULL, |
| 1029 | &error); |
| 1030 | if (!context) |
| 1031 | { |
| 1032 | print_error(error, "Unable to create testing context"); |
| 1033 | gFailCount++; |
| 1034 | gTestsFailed++; |
| 1035 | return TEST_FAIL; |
| 1036 | } |
| 1037 | |
| 1038 | if (device_version < Version(2, 0)) |
| 1039 | { |
| 1040 | queue = clCreateCommandQueue(context, deviceToUse, |
| 1041 | config.queueProps, &error); |
| 1042 | } |
| 1043 | else |
| 1044 | { |
| 1045 | const cl_command_queue_properties cmd_queueProps = |
| 1046 | (config.queueProps) ? CL_QUEUE_PROPERTIES : 0; |
| 1047 | cl_command_queue_properties queueCreateProps[] = { |
| 1048 | cmd_queueProps, config.queueProps, 0 |
| 1049 | }; |
| 1050 | queue = clCreateCommandQueueWithProperties( |
| 1051 | context, deviceToUse, &queueCreateProps[0], &error); |
| 1052 | } |
| 1053 |
no test coverage detected