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

@@ -19,6 +19,25 @@
#include "harness/mt19937.h"
#include "harness/typeWrappers.h"
// This is a macro rather than a function to be able to use and act like the
// existing test_error macro.
//
// Not all compiler tests need to use this macro, only those that don't use the
// test harness compiler helpers.
#define check_compiler_available(DEVICE) \
{ \
cl_bool compilerAvailable = CL_FALSE; \
cl_int error = clGetDeviceInfo((DEVICE), CL_DEVICE_COMPILER_AVAILABLE, \
sizeof(compilerAvailable), \
&compilerAvailable, NULL); \
test_error(error, "Unable to query CL_DEVICE_COMPILER_AVAILABLE"); \
if (compilerAvailable == CL_FALSE) \
{ \
log_info("Skipping test - no compiler is available.\n"); \
return TEST_SKIPPED_ITSELF; \
} \
}
extern int test_load_program_source(cl_device_id deviceID, cl_context context,
cl_command_queue queue, int num_elements);
extern int test_load_multistring_source(cl_device_id deviceID,