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

@@ -409,6 +409,8 @@ int test_unload_invalid(cl_device_id, cl_context, cl_command_queue, int)
int test_unload_repeated(cl_device_id device, cl_context context,
cl_command_queue, int)
{
check_compiler_available(device);
const cl_platform_id platform = device_platform(device);
try
{
@@ -438,6 +440,8 @@ int test_unload_repeated(cl_device_id device, cl_context context,
int test_unload_compile_unload_link(cl_device_id device, cl_context context,
cl_command_queue, int)
{
check_compiler_available(device);
const cl_platform_id platform = device_platform(device);
try
{
@@ -468,6 +472,8 @@ int test_unload_build_unload_create_kernel(cl_device_id device,
cl_context context, cl_command_queue,
int)
{
check_compiler_available(device);
const cl_platform_id platform = device_platform(device);
try
{
@@ -497,6 +503,8 @@ int test_unload_build_unload_create_kernel(cl_device_id device,
int test_unload_link_different(cl_device_id device, cl_context context,
cl_command_queue, int)
{
check_compiler_available(device);
const cl_platform_id platform = device_platform(device);
static const char *sources_1[] = { "unsigned int a() { return 42; }" };
@@ -645,6 +653,8 @@ int test_unload_build_threaded(cl_device_id device, cl_context context,
{
using clock = std::chrono::steady_clock;
check_compiler_available(device);
const cl_platform_id platform = device_platform(device);
const auto end = clock::now() + std::chrono::seconds(5);
@@ -732,6 +742,8 @@ int test_unload_build_threaded(cl_device_id device, cl_context context,
int test_unload_build_info(cl_device_id device, cl_context context,
cl_command_queue, int)
{
check_compiler_available(device);
const cl_platform_id platform = device_platform(device);
static const char *sources[] = { write_kernel_source };
@@ -893,6 +905,8 @@ int test_unload_build_info(cl_device_id device, cl_context context,
int test_unload_program_binaries(cl_device_id device, cl_context context,
cl_command_queue, int)
{
check_compiler_available(device);
const cl_platform_id platform = device_platform(device);
static const char *sources[] = { write_kernel_source };