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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,39 +32,22 @@ 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_1Darray(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(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_1Dbuffer(cl_device_id device, cl_context context,
|
||||
cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(1Dbuffer)
|
||||
{
|
||||
return test_image_set(device, context, queue, k1DBuffer);
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -126,8 +109,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;
|
||||
@@ -153,9 +138,9 @@ 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);
|
||||
}
|
||||
log_info( "\n" );
|
||||
log_info( "You may also use appropriate CL_ channel type and ordering constants.\n" );
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,39 +31,31 @@ static void printUsage( const char *execName );
|
||||
|
||||
extern int test_image_set( cl_device_id device, cl_context context, cl_command_queue queue, cl_mem_object_type image_type );
|
||||
|
||||
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, queue, 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, queue, CL_MEM_OBJECT_IMAGE2D );
|
||||
}
|
||||
int test_3D(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(3D)
|
||||
{
|
||||
return test_image_set( device, context, queue, 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, queue, 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, queue, 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, queue, 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;
|
||||
@@ -114,8 +106,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;
|
||||
@@ -137,8 +131,8 @@ static void printUsage( const char *execName )
|
||||
log_info( "\trandomize - Uses random seed\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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,39 +31,31 @@ 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)
|
||||
REGISTER_TEST(1D)
|
||||
{
|
||||
return test_image_set( device, context, queue, 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, queue, CL_MEM_OBJECT_IMAGE2D );
|
||||
}
|
||||
int test_3D(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(3D)
|
||||
{
|
||||
return test_image_set( device, context, queue, 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, queue, 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, queue, 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, queue, 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;
|
||||
@@ -113,8 +105,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;
|
||||
@@ -134,8 +128,8 @@ static void printUsage( const char *execName )
|
||||
log_info( "\trandomize - Uses random seed\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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -264,140 +264,82 @@ static int doTest( cl_device_id device, cl_context context, cl_command_queue que
|
||||
return ret;
|
||||
}
|
||||
|
||||
int test_1D(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(1D)
|
||||
{
|
||||
return doTest( device, context, queue, 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 doTest( device, context, queue, CL_MEM_OBJECT_IMAGE2D );
|
||||
}
|
||||
int test_3D(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(3D)
|
||||
{
|
||||
return doTest( device, context, queue, 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 doTest( device, context, queue, 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 doTest( device, context, queue, CL_MEM_OBJECT_IMAGE2D_ARRAY );
|
||||
}
|
||||
|
||||
int test_cl_image_requirements_size_ext_negative(cl_device_id device,
|
||||
cl_context context,
|
||||
cl_command_queue queue,
|
||||
int num_elements)
|
||||
REGISTER_TEST_VERSION(cl_image_requirements_size_ext_negative, Version(3, 0))
|
||||
{
|
||||
return cl_image_requirements_size_ext_negative(device, context, queue);
|
||||
}
|
||||
int test_cl_image_requirements_size_ext_consistency(cl_device_id device,
|
||||
cl_context context,
|
||||
cl_command_queue queue,
|
||||
int num_elements)
|
||||
REGISTER_TEST_VERSION(cl_image_requirements_size_ext_consistency, Version(3, 0))
|
||||
{
|
||||
return cl_image_requirements_size_ext_consistency(device, context, queue);
|
||||
}
|
||||
int test_clGetImageRequirementsInfoEXT_negative(cl_device_id device,
|
||||
cl_context context,
|
||||
cl_command_queue queue,
|
||||
int num_elements)
|
||||
REGISTER_TEST_VERSION(clGetImageRequirementsInfoEXT_negative, Version(3, 0))
|
||||
{
|
||||
return clGetImageRequirementsInfoEXT_negative(device, context, queue);
|
||||
}
|
||||
int test_cl_image_requirements_max_val_ext_negative(cl_device_id device,
|
||||
cl_context context,
|
||||
cl_command_queue queue,
|
||||
int num_elements)
|
||||
REGISTER_TEST_VERSION(cl_image_requirements_max_val_ext_negative, Version(3, 0))
|
||||
{
|
||||
return cl_image_requirements_max_val_ext_negative(device, context, queue);
|
||||
}
|
||||
int test_cl_image_requirements_max_val_ext_positive(cl_device_id device,
|
||||
cl_context context,
|
||||
cl_command_queue queue,
|
||||
int num_elements)
|
||||
REGISTER_TEST_VERSION(cl_image_requirements_max_val_ext_positive, Version(3, 0))
|
||||
{
|
||||
return cl_image_requirements_max_val_ext_positive(device, context, queue);
|
||||
}
|
||||
|
||||
int test_image2d_from_buffer_positive(cl_device_id device, cl_context context,
|
||||
cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST_VERSION(image2d_from_buffer_positive, Version(3, 0))
|
||||
{
|
||||
return image2d_from_buffer_positive(device, context, queue);
|
||||
}
|
||||
int test_memInfo_image_from_buffer_positive(cl_device_id device,
|
||||
cl_context context,
|
||||
cl_command_queue queue,
|
||||
int num_elements)
|
||||
REGISTER_TEST_VERSION(memInfo_image_from_buffer_positive, Version(3, 0))
|
||||
{
|
||||
return memInfo_image_from_buffer_positive(device, context, queue);
|
||||
}
|
||||
int test_imageInfo_image_from_buffer_positive(cl_device_id device,
|
||||
cl_context context,
|
||||
cl_command_queue queue,
|
||||
int num_elements)
|
||||
REGISTER_TEST_VERSION(imageInfo_image_from_buffer_positive, Version(3, 0))
|
||||
{
|
||||
return imageInfo_image_from_buffer_positive(device, context, queue);
|
||||
}
|
||||
int test_image_from_buffer_alignment_negative(cl_device_id device,
|
||||
cl_context context,
|
||||
cl_command_queue queue,
|
||||
int num_elements)
|
||||
REGISTER_TEST_VERSION(image_from_buffer_alignment_negative, Version(3, 0))
|
||||
{
|
||||
return image_from_buffer_alignment_negative(device, context, queue);
|
||||
}
|
||||
int test_image_from_small_buffer_negative(cl_device_id device,
|
||||
cl_context context,
|
||||
cl_command_queue queue,
|
||||
int num_elements)
|
||||
REGISTER_TEST_VERSION(image_from_small_buffer_negative, Version(3, 0))
|
||||
{
|
||||
return image_from_small_buffer_negative(device, context, queue);
|
||||
}
|
||||
int test_image_from_buffer_fill_positive(cl_device_id device,
|
||||
cl_context context,
|
||||
cl_command_queue queue,
|
||||
int num_elements)
|
||||
REGISTER_TEST_VERSION(image_from_buffer_fill_positive, Version(3, 0))
|
||||
{
|
||||
return image_from_buffer_fill_positive(device, context, queue);
|
||||
}
|
||||
int test_image_from_buffer_read_positive(cl_device_id device,
|
||||
cl_context context,
|
||||
cl_command_queue queue,
|
||||
int num_elements)
|
||||
REGISTER_TEST_VERSION(image_from_buffer_read_positive, Version(3, 0))
|
||||
{
|
||||
return image_from_buffer_read_positive(device, context, queue);
|
||||
}
|
||||
|
||||
int test_cl_ext_image_raw10_raw12(cl_device_id device, cl_context context,
|
||||
cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST_VERSION(cl_ext_image_raw10_raw12, Version(1, 2))
|
||||
{
|
||||
return ext_image_raw10_raw12(device, context, queue);
|
||||
}
|
||||
|
||||
test_definition test_list[] = {
|
||||
ADD_TEST(1D),
|
||||
ADD_TEST(2D),
|
||||
ADD_TEST(3D),
|
||||
ADD_TEST(1Darray),
|
||||
ADD_TEST(2Darray),
|
||||
ADD_TEST_VERSION(cl_image_requirements_size_ext_negative, Version(3, 0)),
|
||||
ADD_TEST_VERSION(cl_image_requirements_size_ext_consistency, Version(3, 0)),
|
||||
ADD_TEST_VERSION(clGetImageRequirementsInfoEXT_negative, Version(3, 0)),
|
||||
ADD_TEST_VERSION(cl_image_requirements_max_val_ext_negative, Version(3, 0)),
|
||||
ADD_TEST_VERSION(cl_image_requirements_max_val_ext_positive, Version(3, 0)),
|
||||
ADD_TEST_VERSION(image2d_from_buffer_positive, Version(3, 0)),
|
||||
ADD_TEST_VERSION(memInfo_image_from_buffer_positive, Version(3, 0)),
|
||||
ADD_TEST_VERSION(imageInfo_image_from_buffer_positive, Version(3, 0)),
|
||||
ADD_TEST_VERSION(image_from_buffer_alignment_negative, Version(3, 0)),
|
||||
ADD_TEST_VERSION(image_from_small_buffer_negative, Version(3, 0)),
|
||||
ADD_TEST_VERSION(image_from_buffer_fill_positive, Version(3, 0)),
|
||||
ADD_TEST_VERSION(image_from_buffer_read_positive, Version(3, 0)),
|
||||
ADD_TEST_VERSION(cl_ext_image_raw10_raw12, Version(1, 2)),
|
||||
};
|
||||
|
||||
const int test_num = ARRAY_SIZE( test_list );
|
||||
|
||||
int main(int argc, const char *argv[])
|
||||
{
|
||||
cl_channel_type chanType;
|
||||
@@ -532,8 +474,10 @@ int main(int argc, const char *argv[])
|
||||
FPU_mode_type oldMode;
|
||||
DisableFTZ(&oldMode);
|
||||
|
||||
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);
|
||||
|
||||
// Restore FP state before leaving
|
||||
RestoreFPState(&oldMode);
|
||||
@@ -593,8 +537,8 @@ static void printUsage( const char *execName )
|
||||
log_info( "\ttest_mipmaps - Enables mipmapped images\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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,39 +41,31 @@ static void printUsage( const char *execName );
|
||||
|
||||
extern int test_image_set( cl_device_id device, cl_context context, cl_command_queue queue, cl_mem_object_type imageType );
|
||||
|
||||
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, queue, CL_MEM_OBJECT_IMAGE1D);
|
||||
}
|
||||
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, queue, CL_MEM_OBJECT_IMAGE1D_BUFFER);
|
||||
}
|
||||
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, queue, CL_MEM_OBJECT_IMAGE2D );
|
||||
}
|
||||
int test_3D(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(3D)
|
||||
{
|
||||
return test_image_set( device, context, queue, 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, queue, 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, queue, CL_MEM_OBJECT_IMAGE2D_ARRAY );
|
||||
}
|
||||
|
||||
test_definition test_list[] = {
|
||||
ADD_TEST(1D), ADD_TEST(1Dbuffer), ADD_TEST(2D),
|
||||
ADD_TEST(3D), ADD_TEST(1Darray), ADD_TEST(2Darray),
|
||||
};
|
||||
|
||||
const int test_num = ARRAY_SIZE( test_list );
|
||||
|
||||
int main(int argc, const char *argv[])
|
||||
{
|
||||
cl_channel_type chanType;
|
||||
@@ -152,8 +144,10 @@ int main(int argc, const char *argv[])
|
||||
FPU_mode_type oldMode;
|
||||
DisableFTZ(&oldMode);
|
||||
|
||||
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);
|
||||
|
||||
// Restore FP state before leaving
|
||||
RestoreFPState(&oldMode);
|
||||
@@ -187,8 +181,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