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:
@@ -28,15 +28,15 @@ cl_channel_order gChannelOrderToUse = (cl_channel_order)-1;
|
||||
extern int test_image_set( cl_device_id device, cl_context context, cl_mem_object_type image_type );
|
||||
static void printUsage( const char *execName );
|
||||
|
||||
int test_1D(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(1D)
|
||||
{
|
||||
return test_image_set( device, context, CL_MEM_OBJECT_IMAGE1D );
|
||||
}
|
||||
int test_2D(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(2D)
|
||||
{
|
||||
return test_image_set( device, context, CL_MEM_OBJECT_IMAGE2D );
|
||||
}
|
||||
int test_3D(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(3D)
|
||||
{
|
||||
if( checkFor3DImageSupport( device ) )
|
||||
{
|
||||
@@ -46,27 +46,19 @@ int test_3D(cl_device_id device, cl_context context, cl_command_queue queue, int
|
||||
|
||||
return test_image_set( device, context, CL_MEM_OBJECT_IMAGE3D );
|
||||
}
|
||||
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, CL_MEM_OBJECT_IMAGE1D_ARRAY );
|
||||
}
|
||||
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, CL_MEM_OBJECT_IMAGE2D_ARRAY );
|
||||
}
|
||||
int test_1Dbuffer(cl_device_id device, cl_context context,
|
||||
cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(1Dbuffer)
|
||||
{
|
||||
return test_image_set(device, context, CL_MEM_OBJECT_IMAGE1D_BUFFER);
|
||||
}
|
||||
|
||||
test_definition test_list[] = {
|
||||
ADD_TEST(1D), ADD_TEST(2D), ADD_TEST(3D),
|
||||
ADD_TEST(1Darray), ADD_TEST(2Darray), ADD_TEST(1Dbuffer),
|
||||
};
|
||||
|
||||
const int test_num = ARRAY_SIZE( test_list );
|
||||
|
||||
int main(int argc, const char *argv[])
|
||||
{
|
||||
cl_channel_type chanType;
|
||||
@@ -110,8 +102,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;
|
||||
@@ -133,8 +127,8 @@ static void printUsage( const char *execName )
|
||||
log_info( "\trandomize - Seed random number generator (default do not seed random number generator)\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