mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
Migrate images suite to the new test registration framework (#2328)
Contributes to #2181. Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
This commit is contained in:
@@ -33,76 +33,54 @@ extern int test_image_set( cl_device_id device, cl_context context, cl_command_q
|
||||
|
||||
static void printUsage( const char *execName );
|
||||
|
||||
int test_1D(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
|
||||
{
|
||||
return test_image_set( device, context, queue, k1D );
|
||||
}
|
||||
int test_2D(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
|
||||
{
|
||||
return test_image_set( device, context, queue, k2D );
|
||||
}
|
||||
int test_3D(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
|
||||
{
|
||||
return test_image_set( device, context, queue, k3D );
|
||||
}
|
||||
int test_1Dbuffer(cl_device_id device, cl_context context,
|
||||
cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(1D) { return test_image_set(device, context, queue, k1D); }
|
||||
REGISTER_TEST(2D) { return test_image_set(device, context, queue, k2D); }
|
||||
REGISTER_TEST(3D) { return test_image_set(device, context, queue, k3D); }
|
||||
REGISTER_TEST(1Dbuffer)
|
||||
{
|
||||
return test_image_set(device, context, queue, k1DBuffer);
|
||||
}
|
||||
int test_1DTo1Dbuffer(cl_device_id device, cl_context context,
|
||||
cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(1DTo1Dbuffer)
|
||||
{
|
||||
return test_image_set(device, context, queue, k1DTo1DBuffer);
|
||||
}
|
||||
int test_1DbufferTo1D(cl_device_id device, cl_context context,
|
||||
cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(1DbufferTo1D)
|
||||
{
|
||||
return test_image_set(device, context, queue, k1DBufferTo1D);
|
||||
}
|
||||
int test_1Darray(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(1Darray)
|
||||
{
|
||||
return test_image_set( device, context, queue, k1DArray );
|
||||
}
|
||||
int test_2Darray(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(2Darray)
|
||||
{
|
||||
return test_image_set( device, context, queue, k2DArray );
|
||||
}
|
||||
int test_2Dto3D(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(2Dto3D)
|
||||
{
|
||||
return test_image_set( device, context, queue, k2DTo3D );
|
||||
}
|
||||
int test_3Dto2D(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(3Dto2D)
|
||||
{
|
||||
return test_image_set( device, context, queue, k3DTo2D );
|
||||
}
|
||||
int test_2Darrayto2D(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(2Darrayto2D)
|
||||
{
|
||||
return test_image_set( device, context, queue, k2DArrayTo2D );
|
||||
}
|
||||
int test_2Dto2Darray(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(2Dto2Darray)
|
||||
{
|
||||
return test_image_set( device, context, queue, k2DTo2DArray );
|
||||
}
|
||||
int test_2Darrayto3D(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(2Darrayto3D)
|
||||
{
|
||||
return test_image_set( device, context, queue, k2DArrayTo3D );
|
||||
}
|
||||
int test_3Dto2Darray(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(3Dto2Darray)
|
||||
{
|
||||
return test_image_set( device, context, queue, k3DTo2DArray );
|
||||
}
|
||||
|
||||
test_definition test_list[] = {
|
||||
ADD_TEST(1D), ADD_TEST(2D), ADD_TEST(3D),
|
||||
ADD_TEST(1Darray), ADD_TEST(2Darray), ADD_TEST(2Dto3D),
|
||||
ADD_TEST(3Dto2D), ADD_TEST(2Darrayto2D), ADD_TEST(2Dto2Darray),
|
||||
ADD_TEST(2Darrayto3D), ADD_TEST(3Dto2Darray), ADD_TEST(1Dbuffer),
|
||||
ADD_TEST(1DTo1Dbuffer), ADD_TEST(1DbufferTo1D),
|
||||
};
|
||||
|
||||
const int test_num = ARRAY_SIZE( test_list );
|
||||
|
||||
int main(int argc, const char *argv[])
|
||||
{
|
||||
cl_channel_type chanType;
|
||||
@@ -160,8 +138,10 @@ int main(int argc, const char *argv[])
|
||||
if( gTestSmallImages )
|
||||
log_info( "Note: Using small test images\n" );
|
||||
|
||||
int ret = runTestHarnessWithCheck(argCount, argList, test_num, test_list,
|
||||
false, 0, verifyImageSupport);
|
||||
int ret = runTestHarnessWithCheck(
|
||||
argCount, argList, test_registry::getInstance().num_tests(),
|
||||
test_registry::getInstance().definitions(), false, 0,
|
||||
verifyImageSupport);
|
||||
|
||||
free(argList);
|
||||
return ret;
|
||||
@@ -183,8 +163,8 @@ static void printUsage( const char *execName )
|
||||
log_info( "\tuse_pitches - Enables row and slice pitches\n" );
|
||||
log_info( "\n" );
|
||||
log_info( "Test names:\n" );
|
||||
for( int i = 0; i < test_num; i++ )
|
||||
for (size_t i = 0; i < test_registry::getInstance().num_tests(); i++)
|
||||
{
|
||||
log_info( "\t%s\n", test_list[i].name );
|
||||
log_info("\t%s\n", test_registry::getInstance().definitions()[i].name);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user