Migrate compiler suite to the new test registration framework (#2319)

Contributes to #2181.

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
This commit is contained in:
Ahmed Hesham
2025-03-18 17:10:21 +00:00
committed by GitHub
parent d4c292ed46
commit 2131aff0e9
14 changed files with 664 additions and 1002 deletions

View File

@@ -378,7 +378,7 @@ static void unload_platform_compiler(const cl_platform_id platform)
}
/* Test calling the function with a valid platform */
int test_unload_valid(cl_device_id device, cl_context, cl_command_queue, int)
REGISTER_TEST(unload_valid)
{
const cl_platform_id platform = device_platform(device);
const long int err = clUnloadPlatformCompiler(platform);
@@ -393,7 +393,8 @@ int test_unload_valid(cl_device_id device, cl_context, cl_command_queue, int)
}
/* Test calling the function with invalid platform */
int test_unload_invalid(cl_device_id, cl_context, cl_command_queue, int)
/* Disabling temporarily, see GitHub #977
REGISTER_TEST(unload_invalid)
{
const long int err = clUnloadPlatformCompiler(nullptr);
@@ -405,10 +406,10 @@ int test_unload_invalid(cl_device_id, cl_context, cl_command_queue, int)
return 0;
}
*/
/* Test calling the function multiple times in a row */
int test_unload_repeated(cl_device_id device, cl_context context,
cl_command_queue, int)
REGISTER_TEST(unload_repeated)
{
check_compiler_available(device);
@@ -438,8 +439,7 @@ int test_unload_repeated(cl_device_id device, cl_context context,
}
/* Test calling the function between compilation and linking of programs */
int test_unload_compile_unload_link(cl_device_id device, cl_context context,
cl_command_queue, int)
REGISTER_TEST(unload_compile_unload_link)
{
check_compiler_available(device);
@@ -469,9 +469,7 @@ int test_unload_compile_unload_link(cl_device_id device, cl_context context,
}
/* Test calling the function between program build and kernel creation */
int test_unload_build_unload_create_kernel(cl_device_id device,
cl_context context, cl_command_queue,
int)
REGISTER_TEST(unload_build_unload_create_kernel)
{
check_compiler_available(device);
@@ -501,8 +499,7 @@ int test_unload_build_unload_create_kernel(cl_device_id device,
/* Test linking together two programs that were built with a call to the unload
* function in between */
int test_unload_link_different(cl_device_id device, cl_context context,
cl_command_queue, int)
REGISTER_TEST(unload_link_different)
{
check_compiler_available(device);
@@ -587,7 +584,7 @@ int test_unload_link_different(cl_device_id device, cl_context context,
return 1;
}
const clCommandQueueWrapper queue =
const clCommandQueueWrapper test_queue =
clCreateCommandQueue(context, device, 0, &err);
if (CL_SUCCESS != err)
{
@@ -616,8 +613,8 @@ int test_unload_link_different(cl_device_id device, cl_context context,
}
static const size_t work_size = 1;
err = clEnqueueNDRangeKernel(queue, kernel, 1, nullptr, &work_size, nullptr,
0, nullptr, nullptr);
err = clEnqueueNDRangeKernel(test_queue, kernel, 1, nullptr, &work_size,
nullptr, 0, nullptr, nullptr);
if (CL_SUCCESS != err)
{
log_error("Test failure: clEnqueueNDRangeKernel() == %ld\n",
@@ -625,8 +622,8 @@ int test_unload_link_different(cl_device_id device, cl_context context,
return 1;
}
err = clEnqueueReadBuffer(queue, buffer, CL_BLOCKING, 0, sizeof(cl_uint),
&value, 0, nullptr, nullptr);
err = clEnqueueReadBuffer(test_queue, buffer, CL_BLOCKING, 0,
sizeof(cl_uint), &value, 0, nullptr, nullptr);
if (CL_SUCCESS != err)
{
log_error("Test failure: clEnqueueReadBuffer() == %ld\n",
@@ -634,7 +631,7 @@ int test_unload_link_different(cl_device_id device, cl_context context,
return 1;
}
err = clFinish(queue);
err = clFinish(test_queue);
if (CL_SUCCESS != err) throw unload_test_failure("clFinish()", err);
if (42 != value)
@@ -649,8 +646,7 @@ int test_unload_link_different(cl_device_id device, cl_context context,
/* Test calling the function in a thread while others threads are building
* programs */
int test_unload_build_threaded(cl_device_id device, cl_context context,
cl_command_queue, int)
REGISTER_TEST(unload_build_threaded)
{
using clock = std::chrono::steady_clock;
@@ -740,8 +736,7 @@ int test_unload_build_threaded(cl_device_id device, cl_context context,
}
/* Test grabbing program build information after calling the unload function */
int test_unload_build_info(cl_device_id device, cl_context context,
cl_command_queue, int)
REGISTER_TEST(unload_build_info)
{
check_compiler_available(device);
@@ -903,8 +898,7 @@ int test_unload_build_info(cl_device_id device, cl_context context,
/* Test calling the unload function between program building and fetching the
* program binaries */
int test_unload_program_binaries(cl_device_id device, cl_context context,
cl_command_queue, int)
REGISTER_TEST(unload_program_binaries)
{
check_compiler_available(device);