Skip compiler unload/reload tests if compiler is not available (#986)

* Skip compiler unload/reload tests if compiler is not available

Note that tests that use the compiler helper functions but won't work without a
compiler are in the `subtests_to_skip_with_offline_compiler` list.  I didn't do
that here because they tests directly use `clBuildProgram` etc directly,
because they're specifically testing it's behaviour in edge-cases.

* Change type of status variable
This commit is contained in:
Alastair Murray
2020-10-28 08:06:11 +00:00
committed by GitHub
parent c2bca05a32
commit f162c8b5ef
4 changed files with 42 additions and 23 deletions

View File

@@ -721,21 +721,15 @@ int test_consistency_c_features_list(cl_device_id deviceID,
int test_features_macro(cl_device_id deviceID, cl_context context,
cl_command_queue queue, int num_elements)
{
cl_bool compilerAvailable = CL_FALSE;
cl_int error =
clGetDeviceInfo(deviceID, CL_DEVICE_COMPILER_AVAILABLE,
sizeof(compilerAvailable), &compilerAvailable, NULL);
test_error(error, "Unable to query CL_DEVICE_COMPILER_AVAILABLE");
if (compilerAvailable == CL_FALSE)
{
// Note: Not checking that the feature array is empty because the
// specification says "For devices that do not support compilation from
// OpenCL C source, this query may return an empty array." It "may"
// return an empty array implies that an implementation also "may not".
log_info("Skipping test - no compiler is available.\n");
return TEST_SKIPPED_ITSELF;
}
// Note: Not checking that the feature array is empty for the compiler not
// available case because the specification says "For devices that do not
// support compilation from OpenCL C source, this query may return an empty
// array." It "may" return an empty array implies that an implementation
// also "may not".
check_compiler_available(deviceID);
int error = TEST_PASS;
cl_bool supported = CL_FALSE;
std::string test_macro_name = "";
std::vector<std::string> supported_features_vec;