mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-25 16:29:03 +00:00
cl21: Use single array for function list (#147)
Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
This commit is contained in:
committed by
Kévin Petit
parent
c0b9a74583
commit
50ba83e754
@@ -86,37 +86,21 @@ int test_3Dto2Darray(cl_device_id deviceID, cl_context context, cl_command_queue
|
||||
return test_image_set( device, k3DTo2DArray );
|
||||
}
|
||||
|
||||
basefn basefn_list[] = {
|
||||
test_1D,
|
||||
test_2D,
|
||||
test_3D,
|
||||
test_1Darray,
|
||||
test_2Darray,
|
||||
test_2Dto3D,
|
||||
test_3Dto2D,
|
||||
test_2Darrayto2D,
|
||||
test_2Dto2Darray,
|
||||
test_2Darrayto3D,
|
||||
test_3Dto2Darray,
|
||||
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 ),
|
||||
};
|
||||
|
||||
const char *basefn_names[] = {
|
||||
"1D",
|
||||
"2D",
|
||||
"3D",
|
||||
"1Darray",
|
||||
"2Darray",
|
||||
"2Dto3D",
|
||||
"3Dto2D",
|
||||
"2Darrayto2D",
|
||||
"2Dto2Darray",
|
||||
"2Darrayto3D",
|
||||
"3Dto2Darray",
|
||||
};
|
||||
|
||||
ct_assert((sizeof(basefn_names) / sizeof(basefn_names[0])) == (sizeof(basefn_list) / sizeof(basefn_list[0])));
|
||||
|
||||
int num_fns = sizeof(basefn_names) / sizeof(char *);
|
||||
const int test_num = ARRAY_SIZE( test_list );
|
||||
|
||||
int main(int argc, const char *argv[])
|
||||
{
|
||||
@@ -259,7 +243,7 @@ int main(int argc, const char *argv[])
|
||||
if( gTestSmallImages )
|
||||
log_info( "Note: Using small test images\n" );
|
||||
|
||||
int ret = parseAndCallCommandLineTests( argCount, argList, NULL, num_fns, basefn_list, basefn_names, true, 0, 0 );
|
||||
int ret = parseAndCallCommandLineTests( argCount, argList, NULL, test_num, test_list, true, 0, 0 );
|
||||
|
||||
error = clFinish(queue);
|
||||
if (error)
|
||||
@@ -303,8 +287,8 @@ static void printUsage( const char *execName )
|
||||
log_info( "\tuse_ramp - Instead of random data, uses images filled with ramps (and 0xff on any padding pixels) to ease debugging\n" );
|
||||
log_info( "\n" );
|
||||
log_info( "Test names:\n" );
|
||||
for( int i = 0; i < num_fns; i++ )
|
||||
for( int i = 0; i < test_num; i++ )
|
||||
{
|
||||
log_info( "\t%s\n", basefn_names[i] );
|
||||
log_info( "\t%s\n", test_list[i].name );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,25 +61,15 @@ int test_2Darray(cl_device_id deviceID, cl_context context, cl_command_queue que
|
||||
return test_image_set(device, k2DArray);
|
||||
}
|
||||
|
||||
basefn basefn_list[] = {
|
||||
test_1D,
|
||||
test_2D,
|
||||
test_3D,
|
||||
test_1Darray,
|
||||
test_2Darray,
|
||||
test_definition test_list[] = {
|
||||
ADD_TEST( 1D ),
|
||||
ADD_TEST( 2D ),
|
||||
ADD_TEST( 3D ),
|
||||
ADD_TEST( 1Darray ),
|
||||
ADD_TEST( 2Darray ),
|
||||
};
|
||||
|
||||
const char *basefn_names[] = {
|
||||
"1D",
|
||||
"2D",
|
||||
"3D",
|
||||
"1Darray",
|
||||
"2Darray",
|
||||
};
|
||||
|
||||
ct_assert((sizeof(basefn_names) / sizeof(basefn_names[0])) == (sizeof(basefn_list) / sizeof(basefn_list[0])));
|
||||
|
||||
int num_fns = sizeof(basefn_names) / sizeof(char *);
|
||||
const int test_num = ARRAY_SIZE( test_list );
|
||||
|
||||
int main(int argc, const char *argv[])
|
||||
{
|
||||
@@ -224,7 +214,7 @@ int main(int argc, const char *argv[])
|
||||
if ( gTestSmallImages )
|
||||
log_info( "Note: Using small test images\n" );
|
||||
|
||||
int ret = parseAndCallCommandLineTests( argCount, argList, NULL, num_fns, basefn_list, basefn_names, true, 0, 0 );
|
||||
int ret = parseAndCallCommandLineTests( argCount, argList, NULL, test_num, test_list, true, 0, 0 );
|
||||
|
||||
error = clFinish(queue);
|
||||
if (error)
|
||||
@@ -272,9 +262,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 < num_fns; i++ )
|
||||
for( int i = 0; i < test_num; i++ )
|
||||
{
|
||||
log_info( "\t%s\n", basefn_names[i] );
|
||||
log_info( "\t%s\n", test_list[i].name );
|
||||
}
|
||||
log_info( "\n" );
|
||||
log_info( "You may also use appropriate CL_ channel type and ordering constants.\n" );
|
||||
|
||||
@@ -66,25 +66,15 @@ int test_2Darray(cl_device_id deviceID, cl_context context, cl_command_queue que
|
||||
return test_image_set( device, CL_MEM_OBJECT_IMAGE2D_ARRAY );
|
||||
}
|
||||
|
||||
basefn basefn_list[] = {
|
||||
test_1D,
|
||||
test_2D,
|
||||
test_3D,
|
||||
test_1Darray,
|
||||
test_2Darray,
|
||||
test_definition test_list[] = {
|
||||
ADD_TEST( 1D ),
|
||||
ADD_TEST( 2D ),
|
||||
ADD_TEST( 3D ),
|
||||
ADD_TEST( 1Darray ),
|
||||
ADD_TEST( 2Darray ),
|
||||
};
|
||||
|
||||
const char *basefn_names[] = {
|
||||
"1D",
|
||||
"2D",
|
||||
"3D",
|
||||
"1Darray",
|
||||
"2Darray",
|
||||
};
|
||||
|
||||
ct_assert((sizeof(basefn_names) / sizeof(basefn_names[0])) == (sizeof(basefn_list) / sizeof(basefn_list[0])));
|
||||
|
||||
int num_fns = sizeof(basefn_names) / sizeof(char *);
|
||||
const int test_num = ARRAY_SIZE( test_list );
|
||||
|
||||
int main(int argc, const char *argv[])
|
||||
{
|
||||
@@ -267,7 +257,7 @@ int main(int argc, const char *argv[])
|
||||
if( gTestSmallImages )
|
||||
log_info( "Note: Using small test images\n" );
|
||||
|
||||
int ret = parseAndCallCommandLineTests( argCount, argList, NULL, num_fns, basefn_list, basefn_names, true, 0, 0 );
|
||||
int ret = parseAndCallCommandLineTests( argCount, argList, NULL, test_num, test_list, true, 0, 0 );
|
||||
|
||||
if (gTestFailure == 0) {
|
||||
if (gTestCount > 1)
|
||||
@@ -306,8 +296,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 < num_fns; i++ )
|
||||
for( int i = 0; i < test_num; i++ )
|
||||
{
|
||||
log_info( "\t%s\n", basefn_names[i] );
|
||||
log_info( "\t%s\n", test_list[i].name );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,25 +61,15 @@ int test_2Darray(cl_device_id deviceID, cl_context context, cl_command_queue que
|
||||
return test_image_set( device, CL_MEM_OBJECT_IMAGE2D_ARRAY );
|
||||
}
|
||||
|
||||
basefn basefn_list[] = {
|
||||
test_1D,
|
||||
test_2D,
|
||||
test_3D,
|
||||
test_1Darray,
|
||||
test_2Darray,
|
||||
test_definition test_list[] = {
|
||||
ADD_TEST( 1D ),
|
||||
ADD_TEST( 2D ),
|
||||
ADD_TEST( 3D ),
|
||||
ADD_TEST( 1Darray ),
|
||||
ADD_TEST( 2Darray ),
|
||||
};
|
||||
|
||||
const char *basefn_names[] = {
|
||||
"1D",
|
||||
"2D",
|
||||
"3D",
|
||||
"1Darray",
|
||||
"2Darray",
|
||||
};
|
||||
|
||||
ct_assert((sizeof(basefn_names) / sizeof(basefn_names[0])) == (sizeof(basefn_list) / sizeof(basefn_list[0])));
|
||||
|
||||
int num_fns = sizeof(basefn_names) / sizeof(char *);
|
||||
const int test_num = ARRAY_SIZE( test_list );
|
||||
|
||||
int main(int argc, const char *argv[])
|
||||
{
|
||||
@@ -236,7 +226,7 @@ int main(int argc, const char *argv[])
|
||||
if( gTestSmallImages )
|
||||
log_info( "Note: Using small test images\n" );
|
||||
|
||||
int ret = parseAndCallCommandLineTests( argCount, argList, NULL, num_fns, basefn_list, basefn_names, true, 0, 0 );
|
||||
int ret = parseAndCallCommandLineTests( argCount, argList, NULL, test_num, test_list, true, 0, 0 );
|
||||
|
||||
error = clFinish(queue);
|
||||
if (error)
|
||||
@@ -280,8 +270,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 < num_fns; i++ )
|
||||
for( int i = 0; i < test_num; i++ )
|
||||
{
|
||||
log_info( "\t%s\n", basefn_names[i] );
|
||||
log_info( "\t%s\n", test_list[i].name );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,25 +62,15 @@ int test_2Darray(cl_device_id deviceID, cl_context context, cl_command_queue que
|
||||
return test_image_set( device, CL_MEM_OBJECT_IMAGE2D_ARRAY );
|
||||
}
|
||||
|
||||
basefn basefn_list[] = {
|
||||
test_1D,
|
||||
test_2D,
|
||||
test_3D,
|
||||
test_1Darray,
|
||||
test_2Darray,
|
||||
test_definition test_list[] = {
|
||||
ADD_TEST( 1D ),
|
||||
ADD_TEST( 2D ),
|
||||
ADD_TEST( 3D ),
|
||||
ADD_TEST( 1Darray ),
|
||||
ADD_TEST( 2Darray ),
|
||||
};
|
||||
|
||||
const char *basefn_names[] = {
|
||||
"1D",
|
||||
"2D",
|
||||
"3D",
|
||||
"1Darray",
|
||||
"2Darray",
|
||||
};
|
||||
|
||||
ct_assert((sizeof(basefn_names) / sizeof(basefn_names[0])) == (sizeof(basefn_list) / sizeof(basefn_list[0])));
|
||||
|
||||
int num_fns = sizeof(basefn_names) / sizeof(char *);
|
||||
const int test_num = ARRAY_SIZE( test_list );
|
||||
|
||||
int main(int argc, const char *argv[])
|
||||
{
|
||||
@@ -239,7 +229,7 @@ int main(int argc, const char *argv[])
|
||||
if( gTestSmallImages )
|
||||
log_info( "Note: Using small test images\n" );
|
||||
|
||||
int ret = parseAndCallCommandLineTests( argCount, argList, NULL, num_fns, basefn_list, basefn_names, true, 0, 0 );
|
||||
int ret = parseAndCallCommandLineTests( argCount, argList, NULL, test_num, test_list, true, 0, 0 );
|
||||
|
||||
// Clean up
|
||||
error = clFinish(queue);
|
||||
@@ -278,8 +268,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 < num_fns; i++ )
|
||||
for( int i = 0; i < test_num; i++ )
|
||||
{
|
||||
log_info( "\t%s\n", basefn_names[i] );
|
||||
log_info( "\t%s\n", test_list[i].name );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -248,26 +248,15 @@ int test_2Darray(cl_device_id deviceID, cl_context context, cl_command_queue que
|
||||
return doTest( CL_MEM_OBJECT_IMAGE2D_ARRAY );
|
||||
}
|
||||
|
||||
basefn basefn_list[] = {
|
||||
test_1D,
|
||||
test_2D,
|
||||
test_3D,
|
||||
test_1Darray,
|
||||
test_2Darray,
|
||||
test_definition test_list[] = {
|
||||
ADD_TEST( 1D ),
|
||||
ADD_TEST( 2D ),
|
||||
ADD_TEST( 3D ),
|
||||
ADD_TEST( 1Darray ),
|
||||
ADD_TEST( 2Darray ),
|
||||
};
|
||||
|
||||
const char *basefn_names[] = {
|
||||
"1D",
|
||||
"2D",
|
||||
"3D",
|
||||
"1Darray",
|
||||
"2Darray",
|
||||
};
|
||||
|
||||
ct_assert((sizeof(basefn_names) / sizeof(basefn_names[0])) == (sizeof(basefn_list) / sizeof(basefn_list[0])));
|
||||
|
||||
int num_fns = sizeof(basefn_names) / sizeof(char *);
|
||||
|
||||
const int test_num = ARRAY_SIZE( test_list );
|
||||
|
||||
int main(int argc, const char *argv[])
|
||||
{
|
||||
@@ -539,7 +528,7 @@ int main(int argc, const char *argv[])
|
||||
FPU_mode_type oldMode;
|
||||
DisableFTZ(&oldMode);
|
||||
|
||||
int ret = parseAndCallCommandLineTests( argCount, argList, NULL, num_fns, basefn_list, basefn_names, true, 0, 0 );
|
||||
int ret = parseAndCallCommandLineTests( argCount, argList, NULL, test_num, test_list, true, 0, 0 );
|
||||
|
||||
// Restore FP state before leaving
|
||||
RestoreFPState(&oldMode);
|
||||
@@ -621,8 +610,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 < num_fns; i++ )
|
||||
for( int i = 0; i < test_num; i++ )
|
||||
{
|
||||
log_info( "\t%s\n", basefn_names[i] );
|
||||
log_info( "\t%s\n", test_list[i].name );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,25 +75,15 @@ int test_2Darray(cl_device_id deviceID, cl_context context, cl_command_queue que
|
||||
return test_image_set( device, CL_MEM_OBJECT_IMAGE2D_ARRAY );
|
||||
}
|
||||
|
||||
basefn basefn_list[] = {
|
||||
test_1D,
|
||||
test_2D,
|
||||
test_3D,
|
||||
test_1Darray,
|
||||
test_2Darray,
|
||||
test_definition test_list[] = {
|
||||
ADD_TEST( 1D ),
|
||||
ADD_TEST( 2D ),
|
||||
ADD_TEST( 3D ),
|
||||
ADD_TEST( 1Darray ),
|
||||
ADD_TEST( 2Darray ),
|
||||
};
|
||||
|
||||
const char *basefn_names[] = {
|
||||
"1D",
|
||||
"2D",
|
||||
"3D",
|
||||
"1Darray",
|
||||
"2Darray",
|
||||
};
|
||||
|
||||
ct_assert((sizeof(basefn_names) / sizeof(basefn_names[0])) == (sizeof(basefn_list) / sizeof(basefn_list[0])));
|
||||
|
||||
int num_fns = sizeof(basefn_names) / sizeof(char *);
|
||||
const int test_num = ARRAY_SIZE( test_list );
|
||||
|
||||
int main(int argc, const char *argv[])
|
||||
{
|
||||
@@ -261,7 +251,7 @@ int main(int argc, const char *argv[])
|
||||
FPU_mode_type oldMode;
|
||||
DisableFTZ(&oldMode);
|
||||
|
||||
int ret = parseAndCallCommandLineTests( argCount, argList, NULL, num_fns, basefn_list, basefn_names, true, 0, 0 );
|
||||
int ret = parseAndCallCommandLineTests( argCount, argList, NULL, test_num, test_list, true, 0, 0 );
|
||||
|
||||
// Restore FP state before leaving
|
||||
RestoreFPState(&oldMode);
|
||||
@@ -318,8 +308,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 < num_fns; i++ )
|
||||
for( int i = 0; i < test_num; i++ )
|
||||
{
|
||||
log_info( "\t%s\n", basefn_names[i] );
|
||||
log_info( "\t%s\n", test_list[i].name );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user