cl20: Use single array for function list (#146)

Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
This commit is contained in:
Radek Szymanski
2019-04-10 12:29:22 +01:00
committed by Kévin Petit
parent a223b8a9a2
commit a344529c9b
112 changed files with 1917 additions and 3611 deletions

View File

@@ -47,22 +47,20 @@ int gHasLong = 1;
#define DEFAULT_NUM_ELEMENTS 0x4000
int runTestHarness( int argc, const char *argv[], unsigned int num_fns,
basefn fnList[], const char *fnNames[],
int imageSupportRequired, int forceNoContextCreation, cl_command_queue_properties queueProps )
int runTestHarness( int argc, const char *argv[], int testNum, test_definition testList[],
int imageSupportRequired, int forceNoContextCreation, cl_command_queue_properties queueProps )
{
return runTestHarnessWithCheck( argc, argv, num_fns, fnList, fnNames, imageSupportRequired, forceNoContextCreation, queueProps,
return runTestHarnessWithCheck( argc, argv, testNum, testList, imageSupportRequired, forceNoContextCreation, queueProps,
( imageSupportRequired ) ? verifyImageSupport : NULL );
}
int runTestHarnessWithCheck( int argc, const char *argv[], unsigned int num_fns,
basefn fnList[], const char *fnNames[],
int imageSupportRequired, int forceNoContextCreation, cl_command_queue_properties queueProps,
DeviceCheckFn deviceCheckFn )
int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_definition testList[],
int imageSupportRequired, int forceNoContextCreation, cl_command_queue_properties queueProps,
DeviceCheckFn deviceCheckFn )
{
test_start();
cl_device_type device_type = CL_DEVICE_TYPE_DEFAULT;
cl_device_type device_type = CL_DEVICE_TYPE_DEFAULT;
cl_uint num_platforms = 0;
cl_platform_id *platforms;
cl_device_id device;
@@ -74,7 +72,6 @@ int runTestHarnessWithCheck( int argc, const char *argv[], unsigned int num_fns,
int err, ret;
char *endPtr;
unsigned int i;
int based_on_env_var = 0;
@@ -129,15 +126,15 @@ int runTestHarnessWithCheck( int argc, const char *argv[], unsigned int num_fns,
/* Special case: just list the tests */
if( ( argc > 1 ) && (!strcmp( argv[ 1 ], "-list" ) || !strcmp( argv[ 1 ], "-h" ) || !strcmp( argv[ 1 ], "--help" )))
{
log_info( "Usage: %s [<function name>*] [pid<num>] [id<num>] [<device type>]\n", argv[0] );
log_info( "Usage: %s [<test name>*] [pid<num>] [id<num>] [<device type>]\n", argv[0] );
log_info( "\t<function name>\tOne or more of: (wildcard character '*') (default *)\n");
log_info( "\tpid<num>\t\tIndicates platform at index <num> should be used (default 0).\n" );
log_info( "\tid<num>\t\tIndicates device at index <num> should be used (default 0).\n" );
log_info( "\t<device_type>\tcpu|gpu|accelerator|<CL_DEVICE_TYPE_*> (default CL_DEVICE_TYPE_DEFAULT)\n" );
for( i = 0; i < num_fns; i++ )
for( int i = 0; i < testNum; i++ )
{
log_info( "\t\t%s\n", fnNames[ i ] );
log_info( "\t\t%s\n", testList[i].name );
}
test_finish();
return 0;
@@ -460,7 +457,7 @@ int runTestHarnessWithCheck( int argc, const char *argv[], unsigned int num_fns,
DisableFTZ( &oldMode );
#endif
int error = parseAndCallCommandLineTests( argc, argv, device, num_fns, fnList, fnNames, forceNoContextCreation, queueProps, num_elements );
int error = parseAndCallCommandLineTests( argc, argv, device, testNum, testList, forceNoContextCreation, queueProps, num_elements );
#if defined(__APPLE__) && defined(__arm__)
// Restore the old FP mode before leaving.
@@ -470,23 +467,23 @@ int runTestHarnessWithCheck( int argc, const char *argv[], unsigned int num_fns,
return error;
}
static int find_wildcard_matching_functions( const char *fnNames[], unsigned char fnsToCall[], unsigned int num_fns,
static int find_wildcard_matching_functions( test_definition testList[], unsigned char selectedTestList[], int testNum,
const char *wildcard )
{
int found_tests = 0;
size_t wildcard_length = strlen( wildcard ) - 1; /* -1 for the asterisk */
for( unsigned int fnIndex = 0; fnIndex < num_fns; fnIndex++ )
for( int fnIndex = 0; fnIndex < testNum; fnIndex++ )
{
if( strncmp( fnNames[ fnIndex ], wildcard, wildcard_length ) == 0 )
if( strncmp( testList[ fnIndex ].name, wildcard, wildcard_length ) == 0 )
{
if( fnsToCall[ fnIndex ] )
if( selectedTestList[ fnIndex ] )
{
log_error( "ERROR: Test '%s' has already been selected.\n", fnNames[ fnIndex ] );
log_error( "ERROR: Test '%s' has already been selected.\n", testList[ fnIndex ].name );
return EXIT_FAILURE;
}
fnsToCall[ fnIndex ] = 1;
selectedTestList[ fnIndex ] = 1;
found_tests = 1;
}
}
@@ -500,29 +497,29 @@ static int find_wildcard_matching_functions( const char *fnNames[], unsigned cha
return EXIT_SUCCESS;
}
static int find_argument_matching_function( const char *fnNames[], unsigned char *fnsToCall, unsigned int num_fns,
static int find_argument_matching_function( test_definition testList[], unsigned char selectedTestList[], int testNum,
const char *argument )
{
unsigned int fnIndex;
int fnIndex;
for( fnIndex = 0; fnIndex < num_fns; fnIndex++ )
for( fnIndex = 0; fnIndex < testNum; fnIndex++ )
{
if( strcmp( argument, fnNames[ fnIndex ] ) == 0 )
if( strcmp( argument, testList[fnIndex].name ) == 0 )
{
if( fnsToCall[ fnIndex ] )
if( selectedTestList[ fnIndex ] )
{
log_error( "ERROR: Test '%s' has already been selected.\n", fnNames[ fnIndex ] );
log_error( "ERROR: Test '%s' has already been selected.\n", testList[fnIndex].name );
return EXIT_FAILURE;
}
else
{
fnsToCall[ fnIndex ] = 1;
selectedTestList[ fnIndex ] = 1;
break;
}
}
}
if( fnIndex == num_fns )
if( fnIndex == testNum )
{
log_error( "ERROR: The argument '%s' did not match any test names.\n", argument );
return EXIT_FAILURE;
@@ -531,18 +528,18 @@ static int find_argument_matching_function( const char *fnNames[], unsigned char
return EXIT_SUCCESS;
}
int parseAndCallCommandLineTests( int argc, const char *argv[], cl_device_id device, unsigned int num_fns,
basefn fnList[], const char *fnNames[], int forceNoContextCreation,
int parseAndCallCommandLineTests( int argc, const char *argv[], cl_device_id device, int testNum,
test_definition testList[], int forceNoContextCreation,
cl_command_queue_properties queueProps, int num_elements )
{
int ret = EXIT_SUCCESS;
unsigned char *fnsToCall = ( unsigned char* ) calloc( num_fns, 1 );
unsigned char *selectedTestList = ( unsigned char* ) calloc( testNum, 1 );
if( argc == 1 )
{
/* No actual arguments, all tests will be run. */
memset( fnsToCall, 1, num_fns );
memset( selectedTestList, 1, testNum );
}
else
{
@@ -550,18 +547,18 @@ int parseAndCallCommandLineTests( int argc, const char *argv[], cl_device_id dev
{
if( strchr( argv[ argIndex ], '*' ) != NULL )
{
ret = find_wildcard_matching_functions( fnNames, fnsToCall, num_fns, argv[ argIndex ] );
ret = find_wildcard_matching_functions( testList, selectedTestList, testNum, argv[ argIndex ] );
}
else
{
if( strcmp( argv[ argIndex ], "all" ) == 0 )
{
memset( fnsToCall, 1, num_fns );
memset( selectedTestList, 1, testNum );
break;
}
else
{
ret = find_argument_matching_function( fnNames, fnsToCall, num_fns, argv[ argIndex ] );
ret = find_argument_matching_function( testList, selectedTestList, testNum, argv[ argIndex ] );
}
}
@@ -574,7 +571,7 @@ int parseAndCallCommandLineTests( int argc, const char *argv[], cl_device_id dev
if( ret == EXIT_SUCCESS )
{
ret = callTestFunctions( fnList, fnNames, fnsToCall, num_fns, device, forceNoContextCreation, num_elements, queueProps );
ret = callTestFunctions( testList, selectedTestList, testNum, device, forceNoContextCreation, num_elements, queueProps );
if( gTestsFailed == 0 )
{
@@ -602,30 +599,30 @@ int parseAndCallCommandLineTests( int argc, const char *argv[], cl_device_id dev
test_finish();
free( fnsToCall );
free( selectedTestList );
return ret;
}
int callTestFunctions( basefn functionList[], const char *functionNames[], unsigned char functionsToCall[],
int numFunctions, cl_device_id deviceToUse, int forceNoContextCreation,
int callTestFunctions( test_definition testList[], unsigned char selectedTestList[],
int testNum, cl_device_id deviceToUse, int forceNoContextCreation,
int numElementsToUse, cl_command_queue_properties queueProps )
{
int numErrors = 0;
for( int i = 0; i < numFunctions; ++i )
for( int i = 0; i < testNum; ++i )
{
if( functionsToCall[ i ] )
if( selectedTestList[i] )
{
/* Skip any unimplemented tests. */
if( functionList[ i ] != NULL )
if( testList[i].func != NULL )
{
numErrors += callSingleTestFunction( functionList[ i ], functionNames[ i ], deviceToUse,
forceNoContextCreation, numElementsToUse, queueProps );
numErrors += callSingleTestFunction( testList[i], deviceToUse, forceNoContextCreation,
numElementsToUse, queueProps );
}
else
{
log_info( "%s test currently not implemented\n", functionNames[ i ] );
log_info( "%s test currently not implemented\n", testList[i].name );
}
}
}
@@ -639,9 +636,8 @@ void CL_CALLBACK notify_callback(const char *errinfo, const void *private_info,
}
// Actual function execution
int callSingleTestFunction( basefn functionToCall, const char *functionName,
cl_device_id deviceToUse, int forceNoContextCreation,
int numElementsToUse, const cl_queue_properties queueProps )
int callSingleTestFunction( test_definition test, cl_device_id deviceToUse, int forceNoContextCreation,
int numElementsToUse, const cl_queue_properties queueProps )
{
int numErrors = 0, ret;
cl_int error;
@@ -669,29 +665,29 @@ int callSingleTestFunction( basefn functionToCall, const char *functionName,
}
/* Run the test and print the result */
log_info( "%s...\n", functionName );
log_info( "%s...\n", test.name );
fflush( stdout );
error = check_opencl_version_with_testname(functionName, deviceToUse);
test_missing_feature(error, functionName);
error = check_opencl_version_with_testname(test.name, deviceToUse);
test_missing_feature(error, test.name);
ret = functionToCall( deviceToUse, context, queue, numElementsToUse); //test_threaded_function( ptr_basefn_list[i], group, context, num_elements);
ret = test.func(deviceToUse, context, queue, numElementsToUse); //test_threaded_function( ptr_basefn_list[i], group, context, num_elements);
if( ret == TEST_NOT_IMPLEMENTED )
{
/* Tests can also let us know they're not implemented yet */
log_info("%s test currently not implemented\n\n", functionName);
log_info("%s test currently not implemented\n\n", test.name);
}
else
{
/* Print result */
if( ret == 0 ) {
log_info( "%s passed\n", functionName );
log_info( "%s passed\n", test.name );
gTestsPassed++;
}
else
{
numErrors++;
log_error( "%s FAILED\n", functionName );
log_error( "%s FAILED\n", test.name );
gTestsFailed++;
}
}

View File

@@ -23,6 +23,18 @@
extern "C" {
#endif
#define ADD_TEST(fn) {test_##fn, #fn}
#define NOT_IMPLEMENTED_TEST(fn) {NULL, #fn}
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
typedef struct test_definition
{
basefn func;
const char* name;
} test_definition;
typedef enum test_status
{
TEST_PASS = 0,
@@ -35,39 +47,36 @@ extern cl_uint gRandomSeed;
// Supply a list of functions to test here. This will allocate a CL device, create a context, all that
// setup work, and then call each function in turn as dictatated by the passed arguments.
extern int runTestHarness( int argc, const char *argv[], unsigned int num_fns,
basefn fnList[], const char *fnNames[],
int imageSupportRequired, int forceNoContextCreation, cl_command_queue_properties queueProps );
extern int runTestHarness( int argc, const char *argv[], int testNum, test_definition testList[],
int imageSupportRequired, int forceNoContextCreation, cl_command_queue_properties queueProps );
// Device checking function. See runTestHarnessWithCheck. If this function returns anything other than TEST_PASS, the harness exits.
typedef test_status (*DeviceCheckFn)( cl_device_id device );
// Same as runTestHarness, but also supplies a function that checks the created device for required functionality.
extern int runTestHarnessWithCheck( int argc, const char *argv[], unsigned int num_fns,
basefn fnList[], const char *fnNames[],
int imageSupportRequired, int forceNoContextCreation, cl_command_queue_properties queueProps, DeviceCheckFn deviceCheckFn );
extern int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_definition testList[],
int imageSupportRequired, int forceNoContextCreation,
cl_command_queue_properties queueProps, DeviceCheckFn deviceCheckFn );
// The command line parser used by runTestHarness to break up parameters into calls to callTestFunctions
extern int parseAndCallCommandLineTests( int argc, const char *argv[], cl_device_id device, unsigned int num_fns,
basefn *fnList, const char *fnNames[],
int forceNoContextCreation, cl_command_queue_properties queueProps, int num_elements );
extern int parseAndCallCommandLineTests( int argc, const char *argv[], cl_device_id device, int testNum,
test_definition testList[], int forceNoContextCreation,
cl_command_queue_properties queueProps, int num_elements );
// Call this function if you need to do all the setup work yourself, and just need the function list called/
// managed.
// functionList is the actual array of functions
// functionNames is an array of strings representing the name of each function
// functionsToCall is an array of integers (treated as bools) which tell which function is to be called,
// each element at index i, corresponds to the element in functionList at index i
// numFunctions is the number of elements in the arrays
// testList is the data structure that contains test functions and its names
// selectedTestList is an array of integers (treated as bools) which tell which function is to be called,
// each element at index i, corresponds to the element in testList at index i
// testNum is the number of tests in testList and selectedTestList
// contextProps are used to create a testing context for each test
// deviceToUse and numElementsToUse are all just passed to each test function
extern int callTestFunctions( basefn functionList[], const char *functionNames[], unsigned char functionsToCall[],
int numFunctions, cl_device_id deviceToUse, int forceNoContextCreation,
extern int callTestFunctions( test_definition testList[], unsigned char selectedTestList[],
int testNum, cl_device_id deviceToUse, int forceNoContextCreation,
int numElementsToUse, cl_command_queue_properties queueProps );
// This function is called by callTestFunctions, once per function, to do setup, call, logging and cleanup
extern int callSingleTestFunction( basefn functionToCall, const char *functionName,
cl_device_id deviceToUse, int forceNoContextCreation,
extern int callSingleTestFunction( test_definition test, cl_device_id deviceToUse, int forceNoContextCreation,
int numElementsToUse, cl_command_queue_properties queueProps );
///// Miscellaneous steps

View File

@@ -78,19 +78,19 @@ extern cl_int verify_linked_lists_on_device(int qi, cl_command_queue q, c
extern cl_int create_linked_lists_on_device_no_map(int qi, cl_command_queue q, size_t *pAllocator, cl_kernel k, size_t numLists );
extern cl_int verify_linked_lists_on_device_no_map(int qi, cl_command_queue q, cl_int *pNum_correct, cl_kernel k, cl_int ListLength, size_t numLists );
extern int test_byte_granularity(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_set_kernel_exec_info_svm_ptrs(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_fine_grain_memory_consistency(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_fine_grain_sync_buffers(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_shared_address_space_coarse_grain_old_api(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_shared_address_space_coarse_grain_new_api(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_shared_address_space_fine_grain_buffers(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_shared_address_space_fine_grain(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_cross_buffer_pointers_coarse_grain(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_byte_granularity(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_set_kernel_exec_info_svm_ptrs(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_fine_grain_memory_consistency(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_fine_grain_sync_buffers(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_shared_address_space_coarse_grain_old_api(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_shared_address_space_coarse_grain_new_api(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_shared_address_space_fine_grain_buffers(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_shared_address_space_fine_grain(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_cross_buffer_pointers_coarse_grain(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_pointer_passing(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_allocate_shared_buffer(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_shared_sub_buffers(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_enqueue_api(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_allocate_shared_buffer(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_shared_sub_buffers(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_enqueue_api(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern cl_int create_cl_objects(cl_device_id device_from_harness, const char** ppCodeString, cl_context* context, cl_program *program, cl_command_queue *queues, cl_uint *num_devices, cl_device_svm_capabilities required_svm_caps);

View File

@@ -292,47 +292,26 @@ cl_int create_cl_objects(cl_device_id device_from_harness, const char** ppCodeSt
return 0;
}
basefn basefn_list[] = {
test_byte_granularity,
test_set_kernel_exec_info_svm_ptrs,
test_fine_grain_memory_consistency,
test_fine_grain_sync_buffers,
test_shared_address_space_fine_grain,
test_shared_sub_buffers,
test_shared_address_space_fine_grain_buffers,
test_allocate_shared_buffer,
test_shared_address_space_coarse_grain_old_api,
test_shared_address_space_coarse_grain_new_api,
test_cross_buffer_pointers_coarse_grain,
test_svm_pointer_passing,
test_enqueue_api,
test_definition test_list[] = {
ADD_TEST( svm_byte_granularity ),
ADD_TEST( svm_set_kernel_exec_info_svm_ptrs ),
ADD_TEST( svm_fine_grain_memory_consistency ),
ADD_TEST( svm_fine_grain_sync_buffers ),
ADD_TEST( svm_shared_address_space_fine_grain ),
ADD_TEST( svm_shared_sub_buffers ),
ADD_TEST( svm_shared_address_space_fine_grain_buffers ),
ADD_TEST( svm_allocate_shared_buffer ),
ADD_TEST( svm_shared_address_space_coarse_grain_old_api ),
ADD_TEST( svm_shared_address_space_coarse_grain_new_api ),
ADD_TEST( svm_cross_buffer_pointers_coarse_grain ),
ADD_TEST( svm_pointer_passing ),
ADD_TEST( svm_enqueue_api ),
};
const char *basefn_names[] = {
"svm_byte_granularity",
"svm_set_kernel_exec_info_svm_ptrs",
"svm_fine_grain_memory_consistency",
"svm_fine_grain_sync_buffers",
"svm_shared_address_space_fine_grain",
"svm_shared_sub_buffers",
"svm_shared_address_space_fine_grain_buffers",
"svm_allocate_shared_buffer",
"svm_shared_address_space_coarse_grain_old_api",
"svm_shared_address_space_coarse_grain_new_api",
"svm_cross_buffer_pointers_coarse_grain",
"svm_pointer_passing",
"svm_enqueue_api",
};
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[])
{
return runTestHarness( argc, argv, num_fns, basefn_list, basefn_names, false, true, 0 );
return runTestHarness( argc, argv, test_num, test_list, false, true, 0 );
}

View File

@@ -41,7 +41,7 @@ const char* flag_set_names[] = {
};
int test_allocate_shared_buffer(cl_device_id deviceID, cl_context context2, cl_command_queue queue, int num_elements)
int test_svm_allocate_shared_buffer(cl_device_id deviceID, cl_context context2, cl_command_queue queue, int num_elements)
{
clContextWrapper context = NULL;
clProgramWrapper program = NULL;

View File

@@ -49,7 +49,7 @@ const char *byte_manipulation_kernels[] = {
int test_byte_granularity(cl_device_id deviceID, cl_context c, cl_command_queue queue, int num_elements)
int test_svm_byte_granularity(cl_device_id deviceID, cl_context c, cl_command_queue queue, int num_elements)
{
clContextWrapper context;
clProgramWrapper program;

View File

@@ -128,7 +128,7 @@ cl_int verify_linked_lists_on_host(int ci, cl_command_queue cmdq, cl_mem nodes,
// on another device or the host.
// The linked list nodes are allocated from two different buffers this is done to ensure that cross buffer pointers work correctly.
// This basic test is performed for all combinations of devices and the host.
int test_cross_buffer_pointers_coarse_grain(cl_device_id deviceID, cl_context context2, cl_command_queue queue, int num_elements)
int test_svm_cross_buffer_pointers_coarse_grain(cl_device_id deviceID, cl_context context2, cl_command_queue queue, int num_elements)
{
clContextWrapper context = NULL;
clProgramWrapper program = NULL;

View File

@@ -70,7 +70,7 @@ void CL_CALLBACK callback_svm_free(cl_command_queue queue, cl_uint num_svm_point
data->status.store(1, std::memory_order_release);
}
int test_enqueue_api(cl_device_id deviceID, cl_context c, cl_command_queue queue, int num_elements)
int test_svm_enqueue_api(cl_device_id deviceID, cl_context c, cl_command_queue queue, int num_elements)
{
clContextWrapper context = NULL;
clCommandQueueWrapper queues[MAXQ];

View File

@@ -130,7 +130,7 @@ int launch_kernels_and_verify(clContextWrapper &context, clCommandQueueWrapper*
// Each bin in the hash table is a linked list. Each bin is protected against simultaneous
// update using a lock free technique. The correctness of the list is verfied on the host.
// This test requires the new OpenCL 2.0 atomic operations that implement the new seq_cst memory ordering.
int test_fine_grain_memory_consistency(cl_device_id deviceID, cl_context c, cl_command_queue queue, int num_elements)
int test_svm_fine_grain_memory_consistency(cl_device_id deviceID, cl_context c, cl_command_queue queue, int num_elements)
{
clContextWrapper context;
clProgramWrapper program;

View File

@@ -40,7 +40,7 @@ void spawnAnalysisTask(int location)
// Concept: a device kernel is used to search an input image for regions that match a target pattern.
// The device immediately notifies the host when it finds a target (via an atomic operation that works across host and devices).
// The host is then able to spawn a task that further analyzes the target while the device continues searching for more targets.
int test_fine_grain_sync_buffers(cl_device_id deviceID, cl_context c, cl_command_queue queue, int num_elements)
int test_svm_fine_grain_sync_buffers(cl_device_id deviceID, cl_context c, cl_command_queue queue, int num_elements)
{
clContextWrapper context = NULL;
clProgramWrapper program = NULL;

View File

@@ -42,7 +42,7 @@ const char *set_kernel_exec_info_svm_ptrs_kernel[] = {
// Test that clSetKernelExecInfo works correctly with CL_KERNEL_EXEC_INFO_SVM_PTRS flag.
//
int test_set_kernel_exec_info_svm_ptrs(cl_device_id deviceID, cl_context context2, cl_command_queue queue, int num_elements)
int test_svm_set_kernel_exec_info_svm_ptrs(cl_device_id deviceID, cl_context context2, cl_command_queue queue, int num_elements)
{
clContextWrapper c = NULL;
clProgramWrapper program = NULL;

View File

@@ -271,12 +271,12 @@ int shared_address_space_coarse_grain(cl_device_id deviceID, cl_context context2
return 0;
}
int test_shared_address_space_coarse_grain_old_api(cl_device_id deviceID, cl_context context2, cl_command_queue queue, int num_elements)
int test_svm_shared_address_space_coarse_grain_old_api(cl_device_id deviceID, cl_context context2, cl_command_queue queue, int num_elements)
{
return shared_address_space_coarse_grain(deviceID, context2, queue, num_elements, CL_FALSE);
}
int test_shared_address_space_coarse_grain_new_api(cl_device_id deviceID, cl_context context2, cl_command_queue queue, int num_elements)
int test_svm_shared_address_space_coarse_grain_new_api(cl_device_id deviceID, cl_context context2, cl_command_queue queue, int num_elements)
{
return shared_address_space_coarse_grain(deviceID, context2, queue, num_elements, CL_TRUE);
}

View File

@@ -20,7 +20,7 @@
// This is done by creating a linked list on a device and then verifying the correctness of the list
// on another device or the host. This basic test is performed for all combinations of devices and the host that exist within
// the platform. The test passes only if every combination passes.
int test_shared_address_space_fine_grain(cl_device_id deviceID, cl_context context2, cl_command_queue queue, int num_elements)
int test_svm_shared_address_space_fine_grain(cl_device_id deviceID, cl_context context2, cl_command_queue queue, int num_elements)
{
clContextWrapper context = NULL;
clProgramWrapper program = NULL;

View File

@@ -61,7 +61,7 @@ cl_int verify_linked_lists_on_device_no_map(int vi, cl_command_queue cmdq,cl_int
// This is done by creating a linked list on a device and then verifying the correctness of the list
// on another device or the host. This basic test is performed for all combinations of devices and the host that exist within
// the platform. The test passes only if every combination passes.
int test_shared_address_space_fine_grain_buffers(cl_device_id deviceID, cl_context context2, cl_command_queue queue, int num_elements)
int test_svm_shared_address_space_fine_grain_buffers(cl_device_id deviceID, cl_context context2, cl_command_queue queue, int num_elements)
{
clContextWrapper context = NULL;
clProgramWrapper program = NULL;

View File

@@ -125,7 +125,7 @@ cl_int verify_linked_lists_on_host_sb(int ci, cl_command_queue cmdq, cl_mem node
// on another device or the host.
// The linked list nodes are allocated from two different buffers this is done to ensure that cross buffer pointers work correctly.
// This basic test is performed for all combinations of devices and the host.
int test_shared_sub_buffers(cl_device_id deviceID, cl_context context2, cl_command_queue queue, int num_elements)
int test_svm_shared_sub_buffers(cl_device_id deviceID, cl_context context2, cl_command_queue queue, int num_elements)
{
clContextWrapper context = NULL;
clProgramWrapper program = NULL;

View File

@@ -220,27 +220,16 @@ int test_image2d_write_non_blocking(cl_device_id deviceID, cl_context context, c
return doTest( IMAGE_WRITE_NON_BLOCKING );
}
basefn basefn_list[] = {
test_buffer,
test_image2d_read,
test_image2d_write,
test_buffer_non_blocking,
test_image2d_read_non_blocking,
test_image2d_write_non_blocking,
test_definition test_list[] = {
ADD_TEST( buffer ),
ADD_TEST( image2d_read ),
ADD_TEST( image2d_write ),
ADD_TEST( buffer_non_blocking ),
ADD_TEST( image2d_read_non_blocking ),
ADD_TEST( image2d_write_non_blocking ),
};
const char *basefn_names[] = {
"buffer",
"image2d_read",
"image2d_write",
"buffer_non_blocking",
"image2d_read_non_blocking",
"image2d_write_non_blocking",
};
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[])
{
@@ -393,7 +382,7 @@ int main(int argc, const char *argv[])
g_global_mem_size *= 0.60;
}
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 );
free(argList);
@@ -422,8 +411,8 @@ void printUsage( const char *execName )
log_info( "\tdo_not_execute - Disable executing a kernel that accesses all of the memory objects.\n" );
log_info( "\n" );
log_info( "Test names (Allocation Types):\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 );
}
}

View File

@@ -31,185 +31,95 @@
cl_device_type gDeviceType = CL_DEVICE_TYPE_DEFAULT;
bool gTestRounding = false;
basefn basefn_list[] = {
test_get_platform_info,
test_get_sampler_info,
test_get_command_queue_info,
test_get_context_info,
test_get_device_info,
test_enqueue_task,
test_binary_get,
test_program_binary_create,
test_kernel_required_group_size,
test_definition test_list[] = {
ADD_TEST( get_platform_info ),
ADD_TEST( get_sampler_info ),
ADD_TEST( get_command_queue_info ),
ADD_TEST( get_context_info ),
ADD_TEST( get_device_info ),
ADD_TEST( enqueue_task ),
ADD_TEST( binary_get ),
ADD_TEST( binary_create ),
ADD_TEST( kernel_required_group_size ),
test_release_kernel_order,
test_release_during_execute,
ADD_TEST( release_kernel_order ),
ADD_TEST( release_during_execute ),
test_load_single_kernel,
test_load_two_kernels,
test_load_two_kernels_in_one,
test_load_two_kernels_manually,
test_get_program_info_kernel_names,
test_get_kernel_arg_info,
test_create_kernels_in_program,
test_get_kernel_info,
test_execute_kernel_local_sizes,
test_set_kernel_arg_by_index,
test_set_kernel_arg_constant,
test_set_kernel_arg_struct_array,
test_kernel_global_constant,
ADD_TEST( load_single_kernel ),
ADD_TEST( load_two_kernels ),
ADD_TEST( load_two_kernels_in_one ),
ADD_TEST( load_two_kernels_manually ),
ADD_TEST( get_program_info_kernel_names ),
ADD_TEST( get_kernel_arg_info ),
ADD_TEST( create_kernels_in_program ),
ADD_TEST( get_kernel_info ),
ADD_TEST( execute_kernel_local_sizes ),
ADD_TEST( set_kernel_arg_by_index ),
ADD_TEST( set_kernel_arg_constant ),
ADD_TEST( set_kernel_arg_struct_array ),
ADD_TEST( kernel_global_constant ),
test_min_max_thread_dimensions,
test_min_max_work_items_sizes,
test_min_max_work_group_size,
test_min_max_read_image_args,
test_min_max_write_image_args,
test_min_max_mem_alloc_size,
test_min_max_image_2d_width,
test_min_max_image_2d_height,
test_min_max_image_3d_width,
test_min_max_image_3d_height,
test_min_max_image_3d_depth,
test_min_max_image_array_size,
test_min_max_image_buffer_size,
test_min_max_parameter_size,
test_min_max_samplers,
test_min_max_constant_buffer_size,
test_min_max_constant_args,
test_min_max_compute_units,
test_min_max_address_bits,
test_min_max_single_fp_config,
test_min_max_double_fp_config,
test_min_max_local_mem_size,
test_min_max_kernel_preferred_work_group_size_multiple,
test_min_max_execution_capabilities,
test_min_max_queue_properties,
test_min_max_device_version,
test_min_max_language_version,
ADD_TEST( min_max_thread_dimensions ),
ADD_TEST( min_max_work_items_sizes ),
ADD_TEST( min_max_work_group_size ),
ADD_TEST( min_max_read_image_args ),
ADD_TEST( min_max_write_image_args ),
ADD_TEST( min_max_mem_alloc_size ),
ADD_TEST( min_max_image_2d_width ),
ADD_TEST( min_max_image_2d_height ),
ADD_TEST( min_max_image_3d_width ),
ADD_TEST( min_max_image_3d_height ),
ADD_TEST( min_max_image_3d_depth ),
ADD_TEST( min_max_image_array_size ),
ADD_TEST( min_max_image_buffer_size ),
ADD_TEST( min_max_parameter_size ),
ADD_TEST( min_max_samplers ),
ADD_TEST( min_max_constant_buffer_size ),
ADD_TEST( min_max_constant_args ),
ADD_TEST( min_max_compute_units ),
ADD_TEST( min_max_address_bits ),
ADD_TEST( min_max_single_fp_config ),
ADD_TEST( min_max_double_fp_config ),
ADD_TEST( min_max_local_mem_size ),
ADD_TEST( min_max_kernel_preferred_work_group_size_multiple ),
ADD_TEST( min_max_execution_capabilities ),
ADD_TEST( min_max_queue_properties ),
ADD_TEST( min_max_device_version ),
ADD_TEST( min_max_language_version ),
test_kernel_arg_changes,
test_kernel_arg_multi_setup_random,
ADD_TEST( kernel_arg_changes ),
ADD_TEST( kernel_arg_multi_setup_random ),
test_native_kernel,
ADD_TEST( native_kernel ),
test_create_context_from_type,
ADD_TEST( create_context_from_type ),
test_platform_extensions,
test_get_platform_ids,
test_for_bool_type,
ADD_TEST( platform_extensions ),
ADD_TEST( get_platform_ids ),
ADD_TEST( bool_type ),
test_repeated_setup_cleanup,
ADD_TEST( repeated_setup_cleanup ),
test_retain_queue_single,
test_retain_queue_multiple,
test_retain_mem_object_single,
test_retain_mem_object_multiple,
test_min_data_type_align_size_alignment,
ADD_TEST( retain_queue_single ),
ADD_TEST( retain_queue_multiple ),
ADD_TEST( retain_mem_object_single ),
ADD_TEST( retain_mem_object_multiple ),
ADD_TEST( min_data_type_align_size_alignment ),
test_mem_object_destructor_callback,
test_null_buffer_arg,
test_get_buffer_info,
test_get_image2d_info,
test_get_image3d_info,
test_get_image1d_info,
test_get_image1d_array_info,
test_get_image2d_array_info,
ADD_TEST( mem_object_destructor_callback ),
ADD_TEST( null_buffer_arg ),
ADD_TEST( get_buffer_info ),
ADD_TEST( get_image2d_info ),
ADD_TEST( get_image3d_info ),
ADD_TEST( get_image1d_info ),
ADD_TEST( get_image1d_array_info ),
ADD_TEST( get_image2d_array_info ),
};
const char *basefn_names[] = {
"get_platform_info",
"get_sampler_info",
"get_command_queue_info",
"get_context_info",
"get_device_info",
"enqueue_task",
"binary_get",
"binary_create",
"kernel_required_group_size",
"release_kernel_order",
"release_during_execute",
"load_single_kernel",
"load_two_kernels",
"load_two_kernels_in_one",
"load_two_kernels_manually",
"get_program_info_kernel_names",
"get_kernel_arg_info",
"create_kernels_in_program",
"get_kernel_info",
"execute_kernel_local_sizes",
"set_kernel_arg_by_index",
"set_kernel_arg_constant",
"set_kernel_arg_struct_array",
"kernel_global_constant",
"min_max_thread_dimensions",
"min_max_work_items_sizes",
"min_max_work_group_size",
"min_max_read_image_args",
"min_max_write_image_args",
"min_max_mem_alloc_size",
"min_max_image_2d_width",
"min_max_image_2d_height",
"min_max_image_3d_width",
"min_max_image_3d_height",
"min_max_image_3d_depth",
"min_max_image_array_size",
"min_max_image_buffer_size",
"min_max_parameter_size",
"min_max_samplers",
"min_max_constant_buffer_size",
"min_max_constant_args",
"min_max_compute_units",
"min_max_address_bits",
"min_max_single_fp_config",
"min_max_double_fp_config",
"min_max_local_mem_size",
"min_max_kernel_preferred_work_group_size_multiple",
"min_max_execution_capabilities",
"min_max_queue_properties",
"min_max_device_version",
"min_max_language_version",
"kernel_arg_changes",
"kernel_arg_multi_setup_random",
"native_kernel",
"create_context_from_type",
"platform_extensions",
"get_platform_ids",
"bool_type",
"repeated_setup_cleanup",
"retain_queue_single",
"retain_queue_multiple",
"retain_mem_object_single",
"retain_mem_object_multiple",
"min_data_type_align_size_alignment",
"mem_object_destructor_callback",
"null_buffer_arg",
"get_buffer_info",
"get_image2d_info",
"get_image3d_info",
"get_image1d_info",
"get_image1d_array_info",
"get_image2d_array_info",
};
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[])
{
return runTestHarness( argc, argv, num_fns, basefn_list, basefn_names, false, false, 0 );
return runTestHarness( argc, argv, test_num, test_list, false, false, 0 );
}

View File

@@ -29,7 +29,7 @@ extern int test_create_kernels_in_program(cl_device_id deviceID, cl_conte
extern int test_enqueue_task(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_repeated_setup_cleanup(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_for_bool_type(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_bool_type(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_platform_extensions(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_get_platform_info(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_get_sampler_info(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
@@ -39,7 +39,7 @@ extern int test_get_device_info(cl_device_id deviceID, cl_context context
extern int test_kernel_required_group_size(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_binary_get(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_program_binary_create(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_binary_create(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_release_kernel_order(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_release_during_execute(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);

View File

@@ -75,7 +75,7 @@ int test_binary_get(cl_device_id deviceID, cl_context context, cl_command_queue
}
int test_program_binary_create(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
int test_binary_create(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
/* To test this in a self-contained fashion, we have to create a program with
source, then get the binary, then use that binary to reload the program, and then verify */

View File

@@ -35,8 +35,7 @@ const char *kernel_with_bool[] = {
"}\n"
};
int test_for_bool_type(cl_device_id deviceID, cl_context context,
cl_command_queue queue, int num_elements)
int test_bool_type(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
cl_program program;

View File

@@ -24,48 +24,27 @@
#include <unistd.h>
#endif
test_definition test_list[] = {
ADD_TEST( atomic_add ),
ADD_TEST( atomic_sub ),
ADD_TEST( atomic_xchg ),
ADD_TEST( atomic_min ),
ADD_TEST( atomic_max ),
ADD_TEST( atomic_inc ),
ADD_TEST( atomic_dec ),
ADD_TEST( atomic_cmpxchg ),
ADD_TEST( atomic_and ),
ADD_TEST( atomic_or ),
ADD_TEST( atomic_xor ),
basefn basefn_list[] = {
test_atomic_add,
test_atomic_sub,
test_atomic_xchg,
test_atomic_min,
test_atomic_max,
test_atomic_inc,
test_atomic_dec,
test_atomic_cmpxchg,
test_atomic_and,
test_atomic_or,
test_atomic_xor,
test_atomic_add_index,
test_atomic_add_index_bin
ADD_TEST( atomic_add_index ),
ADD_TEST( atomic_add_index_bin ),
};
const char *basefn_names[] = {
"atomic_add",
"atomic_sub",
"atomic_xchg",
"atomic_min",
"atomic_max",
"atomic_inc",
"atomic_dec",
"atomic_cmpxchg",
"atomic_and",
"atomic_or",
"atomic_xor",
"atomic_add_index",
"atomic_add_index_bin",
};
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[])
{
return runTestHarness( argc, argv, num_fns, basefn_list, basefn_names, false, false, 0 );
return runTestHarness( argc, argv, test_num, test_list, false, false, 0 );
}

View File

@@ -31,273 +31,138 @@
cl_device_type gDeviceType = CL_DEVICE_TYPE_DEFAULT;
bool gTestRounding = false;
basefn basefn_list[] = {
test_hostptr,
test_fpmath_float,
test_fpmath_float2,
test_fpmath_float4,
test_intmath_int,
test_intmath_int2,
test_intmath_int4,
test_intmath_long,
test_intmath_long2,
test_intmath_long4,
test_hiloeo,
test_if,
test_sizeof,
test_loop,
test_pointer_cast,
test_local_arg_def,
test_local_kernel_def,
test_local_kernel_scope,
test_constant,
test_constant_source,
test_readimage,
test_readimage_int16,
test_readimage_fp32,
test_writeimage,
test_writeimage_int16,
test_writeimage_fp32,
test_multireadimageonefmt,
test_definition test_list[] = {
ADD_TEST( hostptr ),
ADD_TEST( fpmath_float ),
ADD_TEST( fpmath_float2 ),
ADD_TEST( fpmath_float4 ),
ADD_TEST( intmath_int ),
ADD_TEST( intmath_int2 ),
ADD_TEST( intmath_int4 ),
ADD_TEST( intmath_long ),
ADD_TEST( intmath_long2 ),
ADD_TEST( intmath_long4 ),
ADD_TEST( hiloeo ),
ADD_TEST( if ),
ADD_TEST( sizeof ),
ADD_TEST( loop ),
ADD_TEST( pointer_cast ),
ADD_TEST( local_arg_def ),
ADD_TEST( local_kernel_def ),
ADD_TEST( local_kernel_scope ),
ADD_TEST( constant ),
ADD_TEST( constant_source ),
ADD_TEST( readimage ),
ADD_TEST( readimage_int16 ),
ADD_TEST( readimage_fp32 ),
ADD_TEST( writeimage ),
ADD_TEST( writeimage_int16 ),
ADD_TEST( writeimage_fp32 ),
ADD_TEST( mri_one ),
test_multireadimagemultifmt,
test_image_r8,
test_barrier,
test_wg_barrier,
test_int2float,
test_float2int,
test_imagereadwrite,
test_imagereadwrite3d,
test_readimage3d,
test_readimage3d_int16,
test_readimage3d_fp32,
test_bufferreadwriterect,
test_arrayreadwrite,
test_arraycopy,
test_imagearraycopy,
test_imagearraycopy3d,
test_imagecopy,
test_imagecopy3d,
test_imagerandomcopy,
test_arrayimagecopy,
test_arrayimagecopy3d,
test_imagenpot,
ADD_TEST( mri_multiple ),
ADD_TEST( image_r8 ),
ADD_TEST( barrier ),
ADD_TEST( wg_barrier ),
ADD_TEST( int2float ),
ADD_TEST( float2int ),
ADD_TEST( imagereadwrite ),
ADD_TEST( imagereadwrite3d ),
ADD_TEST( readimage3d ),
ADD_TEST( readimage3d_int16 ),
ADD_TEST( readimage3d_fp32 ),
ADD_TEST( bufferreadwriterect ),
ADD_TEST( arrayreadwrite ),
ADD_TEST( arraycopy ),
ADD_TEST( imagearraycopy ),
ADD_TEST( imagearraycopy3d ),
ADD_TEST( imagecopy ),
ADD_TEST( imagecopy3d ),
ADD_TEST( imagerandomcopy ),
ADD_TEST( arrayimagecopy ),
ADD_TEST( arrayimagecopy3d ),
ADD_TEST( imagenpot ),
test_vload_global,
test_vload_local,
test_vload_constant,
test_vload_private,
test_vstore_global,
test_vstore_local,
test_vstore_private,
ADD_TEST( vload_global ),
ADD_TEST( vload_local ),
ADD_TEST( vload_constant ),
ADD_TEST( vload_private ),
ADD_TEST( vstore_global ),
ADD_TEST( vstore_local ),
ADD_TEST( vstore_private ),
test_createkernelsinprogram,
test_imagedim_pow2,
test_imagedim_non_pow2,
test_image_param,
test_image_multipass_integer_coord,
test_image_multipass_float_coord,
test_explicit_s2v_bool,
test_explicit_s2v_char,
test_explicit_s2v_uchar,
test_explicit_s2v_short,
test_explicit_s2v_ushort,
test_explicit_s2v_int,
test_explicit_s2v_uint,
test_explicit_s2v_long,
test_explicit_s2v_ulong,
test_explicit_s2v_float,
test_explicit_s2v_double,
ADD_TEST( createkernelsinprogram ),
ADD_TEST( imagedim_pow2 ),
ADD_TEST( imagedim_non_pow2 ),
ADD_TEST( image_param ),
ADD_TEST( image_multipass_integer_coord ),
ADD_TEST( image_multipass_float_coord ),
ADD_TEST( explicit_s2v_bool ),
ADD_TEST( explicit_s2v_char ),
ADD_TEST( explicit_s2v_uchar ),
ADD_TEST( explicit_s2v_short ),
ADD_TEST( explicit_s2v_ushort ),
ADD_TEST( explicit_s2v_int ),
ADD_TEST( explicit_s2v_uint ),
ADD_TEST( explicit_s2v_long ),
ADD_TEST( explicit_s2v_ulong ),
ADD_TEST( explicit_s2v_float ),
ADD_TEST( explicit_s2v_double ),
test_enqueue_map_buffer,
test_enqueue_map_image,
ADD_TEST( enqueue_map_buffer ),
ADD_TEST( enqueue_map_image ),
test_work_item_functions,
ADD_TEST( work_item_functions ),
test_astype,
ADD_TEST( astype ),
test_async_copy_global_to_local,
test_async_copy_local_to_global,
test_async_strided_copy_global_to_local,
test_async_strided_copy_local_to_global,
test_prefetch,
ADD_TEST( async_copy_global_to_local ),
ADD_TEST( async_copy_local_to_global ),
ADD_TEST( async_strided_copy_global_to_local ),
ADD_TEST( async_strided_copy_local_to_global ),
ADD_TEST( prefetch ),
test_kernel_call_kernel_function,
test_host_numeric_constants,
test_kernel_numeric_constants,
test_kernel_limit_constants,
test_kernel_preprocessor_macros,
ADD_TEST( kernel_call_kernel_function ),
ADD_TEST( host_numeric_constants ),
ADD_TEST( kernel_numeric_constants ),
ADD_TEST( kernel_limit_constants ),
ADD_TEST( kernel_preprocessor_macros ),
test_basic_parameter_types,
test_vector_creation,
test_vec_type_hint,
test_kernel_memory_alignment_local,
test_kernel_memory_alignment_global,
test_kernel_memory_alignment_constant,
test_kernel_memory_alignment_private,
ADD_TEST( parameter_types ),
ADD_TEST( vector_creation ),
ADD_TEST( vec_type_hint ),
ADD_TEST( kernel_memory_alignment_local ),
ADD_TEST( kernel_memory_alignment_global ),
ADD_TEST( kernel_memory_alignment_constant ),
ADD_TEST( kernel_memory_alignment_private ),
test_progvar_prog_scope_misc,
test_progvar_prog_scope_uninit,
test_progvar_prog_scope_init,
test_progvar_func_scope,
ADD_TEST( progvar_prog_scope_misc ),
ADD_TEST( progvar_prog_scope_uninit ),
ADD_TEST( progvar_prog_scope_init ),
ADD_TEST( progvar_func_scope ),
test_global_work_offsets,
test_get_global_offset,
ADD_TEST( global_work_offsets ),
ADD_TEST( get_global_offset ),
test_global_linear_id,
test_local_linear_id,
test_enqueued_local_size,
ADD_TEST( global_linear_id ),
ADD_TEST( local_linear_id ),
ADD_TEST( enqueued_local_size ),
test_simple_read_image_pitch,
test_simple_write_image_pitch,
ADD_TEST( simple_read_image_pitch ),
ADD_TEST( simple_write_image_pitch ),
#if defined( __APPLE__ )
test_queue_priority,
ADD_TEST( queue_priority ),
#endif
test_get_linear_ids,
test_rw_image_access_qualifier
ADD_TEST( get_linear_ids ),
ADD_TEST( rw_image_access_qualifier ),
};
const char *basefn_names[] = {
"hostptr",
"fpmath_float",
"fpmath_float2",
"fpmath_float4",
"intmath_int",
"intmath_int2",
"intmath_int4",
"intmath_long",
"intmath_long2",
"intmath_long4",
"hiloeo",
"if",
"sizeof",
"loop",
"pointer_cast",
"local_arg_def",
"local_kernel_def",
"local_kernel_scope",
"constant",
"constant_source",
"readimage",
"readimage_int16",
"readimage_fp32",
"writeimage",
"writeimage_int16",
"writeimage_fp32",
"mri_one",
"mri_multiple",
"image_r8",
"barrier",
"wg_barrier",
"int2float",
"float2int",
"imagereadwrite",
"imagereadwrite3d",
"readimage3d",
"readimage3d_int16",
"readimage3d_fp32",
"bufferreadwriterect",
"arrayreadwrite",
"arraycopy",
"imagearraycopy",
"imagearraycopy3d",
"imagecopy",
"imagecopy3d",
"imagerandomcopy",
"arrayimagecopy",
"arrayimagecopy3d",
"imagenpot",
"vload_global",
"vload_local",
"vload_constant",
"vload_private",
"vstore_global",
"vstore_local",
"vstore_private",
"createkernelsinprogram",
"imagedim_pow2",
"imagedim_non_pow2",
"image_param",
"image_multipass_integer_coord",
"image_multipass_float_coord",
"explicit_s2v_bool",
"explicit_s2v_char",
"explicit_s2v_uchar",
"explicit_s2v_short",
"explicit_s2v_ushort",
"explicit_s2v_int",
"explicit_s2v_uint",
"explicit_s2v_long",
"explicit_s2v_ulong",
"explicit_s2v_float",
"explicit_s2v_double",
"enqueue_map_buffer",
"enqueue_map_image",
"work_item_functions",
"astype",
"async_copy_global_to_local",
"async_copy_local_to_global",
"async_strided_copy_global_to_local",
"async_strided_copy_local_to_global",
"prefetch",
"kernel_call_kernel_function",
"host_numeric_constants",
"kernel_numeric_constants",
"kernel_limit_constants",
"kernel_preprocessor_macros",
"parameter_types",
"vector_creation",
"vec_type_hint",
"kernel_memory_alignment_local",
"kernel_memory_alignment_global",
"kernel_memory_alignment_constant",
"kernel_memory_alignment_private",
"progvar_prog_scope_misc",
"progvar_prog_scope_uninit",
"progvar_prog_scope_init",
"progvar_func_scope",
"global_work_offsets",
"get_global_offset",
"global_linear_id",
"local_linear_id",
"enqueued_local_size",
"simple_read_image_pitch",
"simple_write_image_pitch",
#if defined( __APPLE__ )
"queue_priority",
#endif
"get_linear_ids",
"test_rw_image_access_qualifier",
};
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[])
{
return runTestHarness( argc, argv, num_fns, basefn_list, basefn_names, false, false, 0 );
return runTestHarness( argc, argv, test_num, test_list, false, false, 0 );
}

View File

@@ -48,8 +48,8 @@ extern int test_readimage_fp32(cl_device_id deviceID, cl_context context, c
extern int test_writeimage(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_writeimage_int16(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_writeimage_fp32(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_multireadimageonefmt(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_multireadimagemultifmt(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_mri_one(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_mri_multiple(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_image_r8(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_simplebarrier(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_barrier(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
@@ -126,7 +126,7 @@ extern int test_kernel_preprocessor_macros(cl_device_id deviceID, cl_context
extern int test_kernel_call_kernel_function(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_basic_parameter_types(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements);
extern int test_parameter_types(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements);
extern int test_vector_creation(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_vec_type_hint(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);

View File

@@ -46,10 +46,9 @@ const char *kernel_code_long =
" result[1] = %s(ul);\n"
"}\n";
int
test_basic_parameter_types_long(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
int test_parameter_types_long(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
{
clMemWrapper results;
clMemWrapper results;
int error;
size_t global[3] = {1, 1, 1};
float results_back[2*16];
@@ -158,10 +157,9 @@ test_basic_parameter_types_long(cl_device_id device, cl_context context, cl_comm
return total_errors;
}
int
test_basic_parameter_types(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
int test_parameter_types(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
{
clMemWrapper results;
clMemWrapper results;
int error;
size_t global[3] = {1, 1, 1};
float results_back[7*16];
@@ -290,7 +288,7 @@ test_basic_parameter_types(cl_device_id device, cl_context context, cl_command_q
if (gHasLong) {
log_info("Testing long types...\n");
total_errors += test_basic_parameter_types_long( device, context, queue, num_elements );
total_errors += test_parameter_types_long( device, context, queue, num_elements );
}
else {
log_info("Longs unsupported, skipping.");

View File

@@ -111,7 +111,7 @@ verify_multireadimage(void *image[], float *outptr, int w, int h)
int
test_multireadimagemultifmt(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
test_mri_multiple(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
{
cl_mem streams[4];
cl_image_format img_format;

View File

@@ -93,7 +93,7 @@ verify_multireadimage(void *image[], int num_images, float *outptr, int w, int h
}
int test_multireadimageonefmt(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
int test_mri_one(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
{
cl_mem streams[8];
cl_image_format img_format;

View File

@@ -25,7 +25,7 @@
int testBufferSize( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
int test_array_info_size( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
{
cl_mem memobj;
cl_int err;

View File

@@ -21,208 +21,108 @@
#include "procs.h"
#include "../../test_common/harness/testHarness.h"
basefn bufferfn_list[] = {
test_buffer_read_async_int,
test_buffer_read_async_uint,
test_buffer_read_async_long,
test_buffer_read_async_ulong,
test_buffer_read_async_short,
test_buffer_read_async_ushort,
test_buffer_read_async_char,
test_buffer_read_async_uchar,
test_buffer_read_async_float,
test_buffer_read_array_barrier_int,
test_buffer_read_array_barrier_uint,
test_buffer_read_array_barrier_long,
test_buffer_read_array_barrier_ulong,
test_buffer_read_array_barrier_short,
test_buffer_read_array_barrier_ushort,
test_buffer_read_array_barrier_char,
test_buffer_read_array_barrier_uchar,
test_buffer_read_array_barrier_float,
test_buffer_read_int,
test_buffer_read_uint,
test_buffer_read_long,
test_buffer_read_ulong,
test_buffer_read_short,
test_buffer_read_ushort,
test_buffer_read_float,
0, //test_buffer_read_half,
test_buffer_read_char,
test_buffer_read_uchar,
test_buffer_read_struct,
test_buffer_read_random_size,
test_buffer_map_read_int,
test_buffer_map_read_uint,
test_buffer_map_read_long,
test_buffer_map_read_ulong,
test_buffer_map_read_short,
test_buffer_map_read_ushort,
test_buffer_map_read_char,
test_buffer_map_read_uchar,
test_buffer_map_read_float,
test_buffer_map_read_struct,
test_definition test_list[] = {
ADD_TEST( buffer_read_async_int ),
ADD_TEST( buffer_read_async_uint ),
ADD_TEST( buffer_read_async_long ),
ADD_TEST( buffer_read_async_ulong ),
ADD_TEST( buffer_read_async_short ),
ADD_TEST( buffer_read_async_ushort ),
ADD_TEST( buffer_read_async_char ),
ADD_TEST( buffer_read_async_uchar ),
ADD_TEST( buffer_read_async_float ),
ADD_TEST( buffer_read_array_barrier_int ),
ADD_TEST( buffer_read_array_barrier_uint ),
ADD_TEST( buffer_read_array_barrier_long ),
ADD_TEST( buffer_read_array_barrier_ulong ),
ADD_TEST( buffer_read_array_barrier_short ),
ADD_TEST( buffer_read_array_barrier_ushort ),
ADD_TEST( buffer_read_array_barrier_char ),
ADD_TEST( buffer_read_array_barrier_uchar ),
ADD_TEST( buffer_read_array_barrier_float ),
ADD_TEST( buffer_read_int ),
ADD_TEST( buffer_read_uint ),
ADD_TEST( buffer_read_long ),
ADD_TEST( buffer_read_ulong ),
ADD_TEST( buffer_read_short ),
ADD_TEST( buffer_read_ushort ),
ADD_TEST( buffer_read_float ),
NOT_IMPLEMENTED_TEST( buffer_read_half ),
ADD_TEST( buffer_read_char ),
ADD_TEST( buffer_read_uchar ),
ADD_TEST( buffer_read_struct ),
ADD_TEST( buffer_read_random_size ),
ADD_TEST( buffer_map_read_int ),
ADD_TEST( buffer_map_read_uint ),
ADD_TEST( buffer_map_read_long ),
ADD_TEST( buffer_map_read_ulong ),
ADD_TEST( buffer_map_read_short ),
ADD_TEST( buffer_map_read_ushort ),
ADD_TEST( buffer_map_read_char ),
ADD_TEST( buffer_map_read_uchar ),
ADD_TEST( buffer_map_read_float ),
ADD_TEST( buffer_map_read_struct ),
test_buffer_map_write_int,
test_buffer_map_write_uint,
test_buffer_map_write_long,
test_buffer_map_write_ulong,
test_buffer_map_write_short,
test_buffer_map_write_ushort,
test_buffer_map_write_char,
test_buffer_map_write_uchar,
test_buffer_map_write_float,
test_buffer_map_write_struct,
ADD_TEST( buffer_map_write_int ),
ADD_TEST( buffer_map_write_uint ),
ADD_TEST( buffer_map_write_long ),
ADD_TEST( buffer_map_write_ulong ),
ADD_TEST( buffer_map_write_short ),
ADD_TEST( buffer_map_write_ushort ),
ADD_TEST( buffer_map_write_char ),
ADD_TEST( buffer_map_write_uchar ),
ADD_TEST( buffer_map_write_float ),
ADD_TEST( buffer_map_write_struct ),
test_buffer_write_int,
test_buffer_write_uint,
test_buffer_write_short,
test_buffer_write_ushort,
test_buffer_write_char,
test_buffer_write_uchar,
test_buffer_write_float,
0, //test_buffer_write_half,
test_buffer_write_long,
test_buffer_write_ulong,
test_buffer_write_struct,
test_buffer_write_async_int,
test_buffer_write_async_uint,
test_buffer_write_async_short,
test_buffer_write_async_ushort,
test_buffer_write_async_char,
test_buffer_write_async_uchar,
test_buffer_write_async_float,
test_buffer_write_async_long,
test_buffer_write_async_ulong,
test_buffer_copy,
test_buffer_partial_copy,
test_mem_read_write_flags,
test_mem_write_flags,
test_mem_read_flags,
test_mem_copy_host_flags,
0, //test_mem_alloc_ref_flags,
testBufferSize,
ADD_TEST( buffer_write_int ),
ADD_TEST( buffer_write_uint ),
ADD_TEST( buffer_write_short ),
ADD_TEST( buffer_write_ushort ),
ADD_TEST( buffer_write_char ),
ADD_TEST( buffer_write_uchar ),
ADD_TEST( buffer_write_float ),
NOT_IMPLEMENTED_TEST( buffer_write_half ),
ADD_TEST( buffer_write_long ),
ADD_TEST( buffer_write_ulong ),
ADD_TEST( buffer_write_struct ),
ADD_TEST( buffer_write_async_int ),
ADD_TEST( buffer_write_async_uint ),
ADD_TEST( buffer_write_async_short ),
ADD_TEST( buffer_write_async_ushort ),
ADD_TEST( buffer_write_async_char ),
ADD_TEST( buffer_write_async_uchar ),
ADD_TEST( buffer_write_async_float ),
ADD_TEST( buffer_write_async_long ),
ADD_TEST( buffer_write_async_ulong ),
ADD_TEST( buffer_copy ),
ADD_TEST( buffer_partial_copy ),
ADD_TEST( mem_read_write_flags ),
ADD_TEST( mem_write_only_flags ),
ADD_TEST( mem_read_only_flags ),
ADD_TEST( mem_copy_host_flags ),
NOT_IMPLEMENTED_TEST( mem_alloc_ref_flags ),
ADD_TEST( array_info_size ),
test_sub_buffers_read_write,
test_sub_buffers_read_write_dual_devices,
test_sub_buffers_overlapping,
ADD_TEST( sub_buffers_read_write ),
ADD_TEST( sub_buffers_read_write_dual_devices ),
ADD_TEST( sub_buffers_overlapping ),
test_buffer_fill_int,
test_buffer_fill_uint,
test_buffer_fill_short,
test_buffer_fill_ushort,
test_buffer_fill_char,
test_buffer_fill_uchar,
test_buffer_fill_long,
test_buffer_fill_ulong,
test_buffer_fill_float,
test_buffer_fill_struct,
ADD_TEST( buffer_fill_int ),
ADD_TEST( buffer_fill_uint ),
ADD_TEST( buffer_fill_short ),
ADD_TEST( buffer_fill_ushort ),
ADD_TEST( buffer_fill_char ),
ADD_TEST( buffer_fill_uchar ),
ADD_TEST( buffer_fill_long ),
ADD_TEST( buffer_fill_ulong ),
ADD_TEST( buffer_fill_float ),
ADD_TEST( buffer_fill_struct ),
test_buffer_migrate,
test_image_migrate,
ADD_TEST( buffer_migrate ),
ADD_TEST( image_migrate ),
};
const char *bufferfn_names[] = {
"buffer_read_async_int",
"buffer_read_async_uint",
"buffer_read_async_long",
"buffer_read_async_ulong",
"buffer_read_async_short",
"buffer_read_async_ushort",
"buffer_read_async_char",
"buffer_read_async_uchar",
"buffer_read_async_float",
"buffer_read_array_barrier_int",
"buffer_read_array_barrier_uint",
"buffer_read_array_barrier_long",
"buffer_read_array_barrier_ulong",
"buffer_read_array_barrier_short",
"buffer_read_array_barrier_ushort",
"buffer_read_array_barrier_char",
"buffer_read_array_barrier_uchar",
"buffer_read_array_barrier_float",
"buffer_read_int",
"buffer_read_uint",
"buffer_read_long",
"buffer_read_ulong",
"buffer_read_short",
"buffer_read_ushort",
"buffer_read_float",
"buffer_read_half",
"buffer_read_char",
"buffer_read_uchar",
"buffer_read_struct",
"buffer_read_random_size",
"buffer_map_read_int",
"buffer_map_read_uint",
"buffer_map_read_long",
"buffer_map_read_ulong",
"buffer_map_read_short",
"buffer_map_read_ushort",
"buffer_map_read_char",
"buffer_map_read_uchar",
"buffer_map_read_float",
"buffer_map_read_struct",
"buffer_map_write_int",
"buffer_map_write_uint",
"buffer_map_write_long",
"buffer_map_write_ulong",
"buffer_map_write_short",
"buffer_map_write_ushort",
"buffer_map_write_char",
"buffer_map_write_uchar",
"buffer_map_write_float",
"buffer_map_write_struct",
"buffer_write_int",
"buffer_write_uint",
"buffer_write_short",
"buffer_write_ushort",
"buffer_write_char",
"buffer_write_uchar",
"buffer_write_float",
"buffer_write_half",
"buffer_write_long",
"buffer_write_ulong",
"buffer_write_struct",
"buffer_write_async_int",
"buffer_write_async_uint",
"buffer_write_async_short",
"buffer_write_async_ushort",
"buffer_write_async_char",
"buffer_write_async_uchar",
"buffer_write_async_float",
"buffer_write_async_long",
"buffer_write_async_ulong",
"buffer_copy",
"buffer_partial_copy",
"mem_read_write_flags",
"mem_write_only_flags",
"mem_read_only_flags",
"mem_copy_host_flags",
"mem_alloc_ref_flags",
"array_info_size",
"sub_buffers_read_write",
"sub_buffers_read_write_dual_devices",
"sub_buffers_overlapping",
"buffer_fill_int",
"buffer_fill_uint",
"buffer_fill_short",
"buffer_fill_ushort",
"buffer_fill_char",
"buffer_fill_uchar",
"buffer_fill_long",
"buffer_fill_ulong",
"buffer_fill_float",
"buffer_fill_struct",
"buffer_migrate",
"image_migrate",
};
ct_assert((sizeof(bufferfn_names) / sizeof(bufferfn_names[0])) == (sizeof(bufferfn_list) / sizeof(bufferfn_list[0])));
int num_bufferfns = sizeof(bufferfn_names) / sizeof(char *);
const int test_num = ARRAY_SIZE( test_list );
const cl_mem_flags flag_set[] = {
CL_MEM_ALLOC_HOST_PTR,
@@ -241,6 +141,5 @@ const char* flag_set_names[] = {
int main( int argc, const char *argv[] )
{
return runTestHarness( argc, argv, num_bufferfns, bufferfn_list, bufferfn_names,
false, false, 0 );
return runTestHarness( argc, argv, test_num, test_list, false, false, 0 );
}

View File

@@ -83,10 +83,10 @@ extern int test_buffer_write_async_long( cl_device_id deviceID, cl_context
extern int test_buffer_write_async_ulong( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
extern int test_buffer_copy( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
extern int test_buffer_partial_copy( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
extern int testBufferSize( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
extern int test_array_info_size( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
extern int test_mem_read_write_flags( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
extern int test_mem_write_flags( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
extern int test_mem_read_flags( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
extern int test_mem_write_only_flags( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
extern int test_mem_read_only_flags( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
extern int test_mem_copy_host_flags( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
extern int test_mem_alloc_ref_flags( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
extern int test_buffer_map_read_int( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );

View File

@@ -178,7 +178,7 @@ int test_mem_read_write_flags( cl_device_id deviceID, cl_context context, cl_com
} // end test_mem_read_write()
int test_mem_write_flags( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
int test_mem_write_only_flags( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
{
cl_mem buffers[1];
int *inptr, *outptr;
@@ -288,7 +288,7 @@ int test_mem_write_flags( cl_device_id deviceID, cl_context context, cl_command_
} // end test_mem_write()
int test_mem_read_flags( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
int test_mem_read_only_flags( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
{
cl_mem buffers[2];
int *inptr, *outptr;

View File

@@ -46,104 +46,64 @@ extern int test_atomic_fetch_max(cl_device_id deviceID, cl_context context, cl_c
extern int test_atomic_flag(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_atomic_fence(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_atomic_init_svm(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_atomic_store_svm(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_atomic_load_svm(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_atomic_store_load_svm(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_atomic_exchange_svm(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_atomic_compare_exchange_weak_svm(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_atomic_compare_exchange_strong_svm(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_atomic_fetch_add_svm(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_atomic_fetch_sub_svm(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_atomic_fetch_and_svm(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_atomic_fetch_or_svm(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_atomic_fetch_orand_svm(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_atomic_fetch_xor_svm(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_atomic_fetch_xor2_svm(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_atomic_fetch_min_svm(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_atomic_fetch_max_svm(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_atomic_flag_svm(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_atomic_fence_svm(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_atomic_init(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_atomic_store(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_atomic_load(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_atomic_store_load(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_atomic_exchange(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_atomic_compare_exchange_weak(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_atomic_compare_exchange_strong(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_atomic_fetch_add(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_atomic_fetch_sub(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_atomic_fetch_and(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_atomic_fetch_or(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_atomic_fetch_orand(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_atomic_fetch_xor(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_atomic_fetch_xor2(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_atomic_fetch_min(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_atomic_fetch_max(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_atomic_flag(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_atomic_fence(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
basefn basefn_list[] = {
test_atomic_init,
test_atomic_store,
test_atomic_load,
test_atomic_exchange,
test_atomic_compare_exchange_weak,
test_atomic_compare_exchange_strong,
test_atomic_fetch_add,
test_atomic_fetch_sub,
test_atomic_fetch_and,
test_atomic_fetch_or,
test_atomic_fetch_orand,
test_atomic_fetch_xor,
test_atomic_fetch_xor2,
test_atomic_fetch_min,
test_atomic_fetch_max,
test_atomic_flag,
test_atomic_fence,
test_definition test_list[] = {
ADD_TEST( atomic_init ),
ADD_TEST( atomic_store ),
ADD_TEST( atomic_load ),
ADD_TEST( atomic_exchange ),
ADD_TEST( atomic_compare_exchange_weak ),
ADD_TEST( atomic_compare_exchange_strong ),
ADD_TEST( atomic_fetch_add ),
ADD_TEST( atomic_fetch_sub ),
ADD_TEST( atomic_fetch_and ),
ADD_TEST( atomic_fetch_or ),
ADD_TEST( atomic_fetch_orand ),
ADD_TEST( atomic_fetch_xor ),
ADD_TEST( atomic_fetch_xor2 ),
ADD_TEST( atomic_fetch_min ),
ADD_TEST( atomic_fetch_max ),
ADD_TEST( atomic_flag ),
ADD_TEST( atomic_fence ),
test_atomic_init_svm,
test_atomic_store_svm,
test_atomic_load_svm,
test_atomic_exchange_svm,
test_atomic_compare_exchange_weak_svm,
test_atomic_compare_exchange_strong_svm,
test_atomic_fetch_add_svm,
test_atomic_fetch_sub_svm,
test_atomic_fetch_and_svm,
test_atomic_fetch_or_svm,
test_atomic_fetch_orand_svm,
test_atomic_fetch_xor_svm,
test_atomic_fetch_xor2_svm,
test_atomic_fetch_min_svm,
test_atomic_fetch_max_svm,
test_atomic_flag_svm,
test_atomic_fence_svm
ADD_TEST( svm_atomic_init ),
ADD_TEST( svm_atomic_store ),
ADD_TEST( svm_atomic_load ),
ADD_TEST( svm_atomic_exchange ),
ADD_TEST( svm_atomic_compare_exchange_weak ),
ADD_TEST( svm_atomic_compare_exchange_strong ),
ADD_TEST( svm_atomic_fetch_add ),
ADD_TEST( svm_atomic_fetch_sub ),
ADD_TEST( svm_atomic_fetch_and ),
ADD_TEST( svm_atomic_fetch_or ),
ADD_TEST( svm_atomic_fetch_orand ),
ADD_TEST( svm_atomic_fetch_xor ),
ADD_TEST( svm_atomic_fetch_xor2 ),
ADD_TEST( svm_atomic_fetch_min ),
ADD_TEST( svm_atomic_fetch_max ),
ADD_TEST( svm_atomic_flag ),
ADD_TEST( svm_atomic_fence ),
};
const char *basefn_names[] = {
"atomic_init",
"atomic_store",
"atomic_load",
"atomic_exchange",
"atomic_compare_exchange_weak",
"atomic_compare_exchange_strong",
"atomic_fetch_add",
"atomic_fetch_sub",
"atomic_fetch_and",
"atomic_fetch_or",
"atomic_fetch_orand",
"atomic_fetch_xor",
"atomic_fetch_xor2",
"atomic_fetch_min",
"atomic_fetch_max",
"atomic_flag",
"atomic_fence",
"svm_atomic_init",
"svm_atomic_store",
"svm_atomic_load",
"svm_atomic_exchange",
"svm_atomic_compare_exchange_weak",
"svm_atomic_compare_exchange_strong",
"svm_atomic_fetch_add",
"svm_atomic_fetch_sub",
"svm_atomic_fetch_and",
"svm_atomic_fetch_or",
"svm_atomic_fetch_orand",
"svm_atomic_fetch_xor",
"svm_atomic_fetch_xor2",
"svm_atomic_fetch_min",
"svm_atomic_fetch_max",
"svm_atomic_flag",
"svm_atomic_fence",
};
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[])
{
@@ -226,5 +186,5 @@ int main(int argc, const char *argv[])
log_info("*** Use of this mode is not sufficient to verify correctness. ***\n");
log_info("*** ***\n");
}
return runTestHarness(argc, argv, num_fns, basefn_list, basefn_names, false, false, 0);
return runTestHarness(argc, argv, test_num, test_list, false, false, 0);
}

View File

@@ -108,7 +108,7 @@ int test_atomic_store(cl_device_id deviceID, cl_context context, cl_command_queu
return test_atomic_store_generic(deviceID, context, queue, num_elements, false);
}
int test_atomic_store_svm(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
int test_svm_atomic_store(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
return test_atomic_store_generic(deviceID, context, queue, num_elements, true);
}
@@ -187,7 +187,7 @@ int test_atomic_init(cl_device_id deviceID, cl_context context, cl_command_queue
return test_atomic_init_generic(deviceID, context, queue, num_elements, false);
}
int test_atomic_init_svm(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
int test_svm_atomic_init(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
return test_atomic_init_generic(deviceID, context, queue, num_elements, true);
}
@@ -293,7 +293,7 @@ int test_atomic_load(cl_device_id deviceID, cl_context context, cl_command_queue
return test_atomic_load_generic(deviceID, context, queue, num_elements, false);
}
int test_atomic_load_svm(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
int test_svm_atomic_load(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
return test_atomic_load_generic(deviceID, context, queue, num_elements, true);
}
@@ -421,7 +421,7 @@ int test_atomic_exchange(cl_device_id deviceID, cl_context context, cl_command_q
return test_atomic_exchange_generic(deviceID, context, queue, num_elements, false);
}
int test_atomic_exchange_svm(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
int test_svm_atomic_exchange(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
return test_atomic_exchange_generic(deviceID, context, queue, num_elements, true);
}
@@ -593,7 +593,7 @@ int test_atomic_compare_exchange_strong(cl_device_id deviceID, cl_context contex
return test_atomic_compare_exchange_strong_generic(deviceID, context, queue, num_elements, false);
}
int test_atomic_compare_exchange_strong_svm(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
int test_svm_atomic_compare_exchange_strong(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
return test_atomic_compare_exchange_strong_generic(deviceID, context, queue, num_elements, true);
}
@@ -677,7 +677,7 @@ int test_atomic_compare_exchange_weak(cl_device_id deviceID, cl_context context,
return test_atomic_compare_exchange_weak_generic(deviceID, context, queue, num_elements, false);
}
int test_atomic_compare_exchange_weak_svm(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
int test_svm_atomic_compare_exchange_weak(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
return test_atomic_compare_exchange_weak_generic(deviceID, context, queue, num_elements, true);
}
@@ -760,7 +760,7 @@ int test_atomic_fetch_add(cl_device_id deviceID, cl_context context, cl_command_
return test_atomic_fetch_add_generic(deviceID, context, queue, num_elements, false);
}
int test_atomic_fetch_add_svm(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
int test_svm_atomic_fetch_add(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
return test_atomic_fetch_add_generic(deviceID, context, queue, num_elements, true);
}
@@ -837,7 +837,7 @@ int test_atomic_fetch_sub(cl_device_id deviceID, cl_context context, cl_command_
return test_atomic_fetch_sub_generic(deviceID, context, queue, num_elements, false);
}
int test_atomic_fetch_sub_svm(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
int test_svm_atomic_fetch_sub(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
return test_atomic_fetch_sub_generic(deviceID, context, queue, num_elements, true);
}
@@ -937,7 +937,7 @@ int test_atomic_fetch_or(cl_device_id deviceID, cl_context context, cl_command_q
return test_atomic_fetch_or_generic(deviceID, context, queue, num_elements, false);
}
int test_atomic_fetch_or_svm(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
int test_svm_atomic_fetch_or(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
return test_atomic_fetch_or_generic(deviceID, context, queue, num_elements, true);
}
@@ -1025,7 +1025,7 @@ int test_atomic_fetch_xor(cl_device_id deviceID, cl_context context, cl_command_
return test_atomic_fetch_xor_generic(deviceID, context, queue, num_elements, false);
}
int test_atomic_fetch_xor_svm(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
int test_svm_atomic_fetch_xor(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
return test_atomic_fetch_xor_generic(deviceID, context, queue, num_elements, true);
}
@@ -1125,7 +1125,7 @@ int test_atomic_fetch_and(cl_device_id deviceID, cl_context context, cl_command_
return test_atomic_fetch_and_generic(deviceID, context, queue, num_elements, false);
}
int test_atomic_fetch_and_svm(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
int test_svm_atomic_fetch_and(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
return test_atomic_fetch_and_generic(deviceID, context, queue, num_elements, true);
}
@@ -1247,7 +1247,7 @@ int test_atomic_fetch_orand(cl_device_id deviceID, cl_context context, cl_comman
return test_atomic_fetch_orand_generic(deviceID, context, queue, num_elements, false);
}
int test_atomic_fetch_orand_svm(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
int test_svm_atomic_fetch_orand(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
return test_atomic_fetch_orand_generic(deviceID, context, queue, num_elements, true);
}
@@ -1369,7 +1369,7 @@ int test_atomic_fetch_xor2(cl_device_id deviceID, cl_context context, cl_command
return test_atomic_fetch_xor2_generic(deviceID, context, queue, num_elements, false);
}
int test_atomic_fetch_xor2_svm(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
int test_svm_atomic_fetch_xor2(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
return test_atomic_fetch_xor2_generic(deviceID, context, queue, num_elements, true);
}
@@ -1460,7 +1460,7 @@ int test_atomic_fetch_min(cl_device_id deviceID, cl_context context, cl_command_
return test_atomic_fetch_min_generic(deviceID, context, queue, num_elements, false);
}
int test_atomic_fetch_min_svm(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
int test_svm_atomic_fetch_min(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
return test_atomic_fetch_min_generic(deviceID, context, queue, num_elements, true);
}
@@ -1551,7 +1551,7 @@ int test_atomic_fetch_max(cl_device_id deviceID, cl_context context, cl_command_
return test_atomic_fetch_max_generic(deviceID, context, queue, num_elements, false);
}
int test_atomic_fetch_max_svm(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
int test_svm_atomic_fetch_max(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
return test_atomic_fetch_max_generic(deviceID, context, queue, num_elements, true);
}
@@ -1720,7 +1720,7 @@ int test_atomic_flag(cl_device_id deviceID, cl_context context, cl_command_queue
return test_atomic_flag_generic(deviceID, context, queue, num_elements, false);
}
int test_atomic_flag_svm(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
int test_svm_atomic_flag(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
return test_atomic_flag_generic(deviceID, context, queue, num_elements, true);
}
@@ -2137,7 +2137,7 @@ int test_atomic_fence(cl_device_id deviceID, cl_context context, cl_command_queu
return test_atomic_fence_generic(deviceID, context, queue, num_elements, false);
}
int test_atomic_fence_svm(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
int test_svm_atomic_fence(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
return test_atomic_fence_generic(deviceID, context, queue, num_elements, true);
}

View File

@@ -25,63 +25,39 @@ int g_arrStrangeVectorSizes[kStrangeVectorSizeCount] = {3};
static void initVecSizes() {
int i;
for(i = 0; i < kVectorSizeCount; ++i) {
g_arrVecSizes[i] = (1<<i);
g_arrVecSizes[i] = (1<<i);
}
for(; i < kVectorSizeCount + kStrangeVectorSizeCount; ++i) {
g_arrVecSizes[i] = g_arrStrangeVectorSizes[i-kVectorSizeCount];
g_arrVecSizes[i] = g_arrStrangeVectorSizes[i-kVectorSizeCount];
}
}
basefn commonfn_list[] = {
test_clamp,
test_degrees,
test_fmax,
test_fmaxf,
test_fmin,
test_fminf,
test_max,
test_maxf,
test_min,
test_minf,
test_mix,
test_radians,
test_step,
test_stepf,
test_smoothstep,
test_smoothstepf,
test_sign,
test_definition test_list[] = {
ADD_TEST( clamp ),
ADD_TEST( degrees ),
ADD_TEST( fmax ),
ADD_TEST( fmaxf ),
ADD_TEST( fmin ),
ADD_TEST( fminf ),
ADD_TEST( max ),
ADD_TEST( maxf ),
ADD_TEST( min ),
ADD_TEST( minf ),
ADD_TEST( mix ),
ADD_TEST( radians ),
ADD_TEST( step ),
ADD_TEST( stepf ),
ADD_TEST( smoothstep ),
ADD_TEST( smoothstepf ),
ADD_TEST( sign ),
};
const char *commonfn_names[] = {
"clamp",
"degrees",
"fmax",
"fmaxf",
"fmin",
"fminf",
"max",
"maxf",
"min",
"minf",
"mix",
"radians",
"step",
"stepf",
"smoothstep",
"smoothstepf",
"sign",
};
const int test_num = ARRAY_SIZE( test_list );
ct_assert((sizeof(commonfn_names) / sizeof(commonfn_names[0])) == (sizeof(commonfn_list) / sizeof(commonfn_list[0])));
int num_commonfns = sizeof(commonfn_names) / sizeof(char *);
int
main(int argc, const char *argv[])
int main(int argc, const char *argv[])
{
initVecSizes();
return runTestHarness( argc, argv, num_commonfns, commonfn_list, commonfn_names, false, false, 0 );
return runTestHarness( argc, argv, test_num, test_list, false, false, 0 );
}

View File

@@ -52,23 +52,21 @@ int gHasLong = 1;
#define DEFAULT_NUM_ELEMENTS 0x4000
int runTestHarness( int argc, const char *argv[], unsigned int num_fns,
basefn fnList[], const char *fnNames[],
int imageSupportRequired, int forceNoContextCreation, cl_command_queue_properties queueProps )
int runTestHarness( int argc, const char *argv[], int testNum, test_definition testList[],
int imageSupportRequired, int forceNoContextCreation, cl_command_queue_properties queueProps )
{
return runTestHarnessWithCheck( argc, argv, num_fns, fnList, fnNames, imageSupportRequired, forceNoContextCreation, queueProps,
return runTestHarnessWithCheck( argc, argv, testNum, testList, imageSupportRequired, forceNoContextCreation, queueProps,
( imageSupportRequired ) ? verifyImageSupport : NULL );
}
int runTestHarnessWithCheck( int argc, const char *argv[], unsigned int num_fns,
basefn fnList[], const char *fnNames[],
int imageSupportRequired, int forceNoContextCreation, cl_command_queue_properties queueProps,
DeviceCheckFn deviceCheckFn )
int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_definition testList[],
int imageSupportRequired, int forceNoContextCreation, cl_command_queue_properties queueProps,
DeviceCheckFn deviceCheckFn )
{
test_start();
log_info("*** Compatibility with Previous Versions test ***\n");
cl_device_type device_type = CL_DEVICE_TYPE_DEFAULT;
cl_device_type device_type = CL_DEVICE_TYPE_DEFAULT;
cl_uint num_platforms = 0;
cl_platform_id *platforms;
cl_device_id device;
@@ -80,7 +78,6 @@ int runTestHarnessWithCheck( int argc, const char *argv[], unsigned int num_fns,
int err, ret;
char *endPtr;
unsigned int i;
int based_on_env_var = 0;
@@ -135,15 +132,15 @@ int runTestHarnessWithCheck( int argc, const char *argv[], unsigned int num_fns,
/* Special case: just list the tests */
if( ( argc > 1 ) && (!strcmp( argv[ 1 ], "-list" ) || !strcmp( argv[ 1 ], "-h" ) || !strcmp( argv[ 1 ], "--help" )))
{
log_info( "Usage: %s [<function name>*] [pid<num>] [id<num>] [<device type>]\n", argv[0] );
log_info( "Usage: %s [<test name>*] [pid<num>] [id<num>] [<device type>]\n", argv[0] );
log_info( "\t<function name>\tOne or more of: (wildcard character '*') (default *)\n");
log_info( "\tpid<num>\t\tIndicates platform at index <num> should be used (default 0).\n" );
log_info( "\tid<num>\t\tIndicates device at index <num> should be used (default 0).\n" );
log_info( "\t<device_type>\tcpu|gpu|accelerator|<CL_DEVICE_TYPE_*> (default CL_DEVICE_TYPE_DEFAULT)\n" );
for( i = 0; i < num_fns - 1; i++ )
for( int i = 0; i < testNum; i++ )
{
log_info( "\t\t%s\n", fnNames[ i ] );
log_info( "\t\t%s\n", testList[i].name );
}
test_finish();
return 0;
@@ -468,7 +465,7 @@ int runTestHarnessWithCheck( int argc, const char *argv[], unsigned int num_fns,
DisableFTZ( &oldMode );
#endif
int error = parseAndCallCommandLineTests( argc, argv, device, num_fns, fnList, fnNames, forceNoContextCreation, queueProps, num_elements );
int error = parseAndCallCommandLineTests( argc, argv, device, testNum, testList, forceNoContextCreation, queueProps, num_elements );
#if defined(__APPLE__) && defined(__arm__)
// Restore the old FP mode before leaving.
@@ -478,23 +475,23 @@ int runTestHarnessWithCheck( int argc, const char *argv[], unsigned int num_fns,
return error;
}
static int find_wildcard_matching_functions( const char *fnNames[], unsigned char fnsToCall[], unsigned int num_fns,
static int find_wildcard_matching_functions( test_definition testList[], unsigned char selectedTestList[], int testNum,
const char *wildcard )
{
int found_tests = 0;
size_t wildcard_length = strlen( wildcard ) - 1; /* -1 for the asterisk */
for( unsigned int fnIndex = 0; fnIndex < num_fns; fnIndex++ )
for( int fnIndex = 0; fnIndex < testNum; fnIndex++ )
{
if( strncmp( fnNames[ fnIndex ], wildcard, wildcard_length ) == 0 )
if( strncmp( testList[ fnIndex ].name, wildcard, wildcard_length ) == 0 )
{
if( fnsToCall[ fnIndex ] )
if( selectedTestList[ fnIndex ] )
{
log_error( "ERROR: Test '%s' has already been selected.\n", fnNames[ fnIndex ] );
log_error( "ERROR: Test '%s' has already been selected.\n", testList[ fnIndex ].name );
return EXIT_FAILURE;
}
fnsToCall[ fnIndex ] = 1;
selectedTestList[ fnIndex ] = 1;
found_tests = 1;
}
}
@@ -508,29 +505,29 @@ static int find_wildcard_matching_functions( const char *fnNames[], unsigned cha
return EXIT_SUCCESS;
}
static int find_argument_matching_function( const char *fnNames[], unsigned char *fnsToCall, unsigned int num_fns,
static int find_argument_matching_function( test_definition testList[], unsigned char selectedTestList[], int testNum,
const char *argument )
{
unsigned int fnIndex;
int fnIndex;
for( fnIndex = 0; fnIndex < num_fns; fnIndex++ )
for( fnIndex = 0; fnIndex < testNum; fnIndex++ )
{
if( strcmp( argument, fnNames[ fnIndex ] ) == 0 )
if( strcmp( argument, testList[ fnIndex ].name ) == 0 )
{
if( fnsToCall[ fnIndex ] )
if( selectedTestList[ fnIndex ] )
{
log_error( "ERROR: Test '%s' has already been selected.\n", fnNames[ fnIndex ] );
log_error( "ERROR: Test '%s' has already been selected.\n", testList[ fnIndex ].name );
return EXIT_FAILURE;
}
else
{
fnsToCall[ fnIndex ] = 1;
selectedTestList[ fnIndex ] = 1;
break;
}
}
}
if( fnIndex == num_fns )
if( fnIndex == testNum )
{
log_error( "ERROR: The argument '%s' did not match any test names.\n", argument );
return EXIT_FAILURE;
@@ -539,18 +536,18 @@ static int find_argument_matching_function( const char *fnNames[], unsigned char
return EXIT_SUCCESS;
}
int parseAndCallCommandLineTests( int argc, const char *argv[], cl_device_id device, unsigned int num_fns,
basefn fnList[], const char *fnNames[], int forceNoContextCreation,
int parseAndCallCommandLineTests( int argc, const char *argv[], cl_device_id device, int testNum,
test_definition testList[], int forceNoContextCreation,
cl_command_queue_properties queueProps, int num_elements )
{
int ret = EXIT_SUCCESS;
unsigned char *fnsToCall = ( unsigned char* ) calloc( num_fns, 1 );
unsigned char *selectedTestList = ( unsigned char* ) calloc( testNum, 1 );
if( argc == 1 )
{
/* No actual arguments, all tests will be run. */
memset( fnsToCall, 1, num_fns );
memset( selectedTestList, 1, testNum );
}
else
{
@@ -558,18 +555,18 @@ int parseAndCallCommandLineTests( int argc, const char *argv[], cl_device_id dev
{
if( strchr( argv[ argIndex ], '*' ) != NULL )
{
ret = find_wildcard_matching_functions( fnNames, fnsToCall, num_fns, argv[ argIndex ] );
ret = find_wildcard_matching_functions( testList, selectedTestList, testNum, argv[ argIndex ] );
}
else
{
if( strcmp( argv[ argIndex ], "all" ) == 0 )
{
memset( fnsToCall, 1, num_fns );
memset( selectedTestList, 1, testNum );
break;
}
else
{
ret = find_argument_matching_function( fnNames, fnsToCall, num_fns, argv[ argIndex ] );
ret = find_argument_matching_function( testList, selectedTestList, testNum, argv[ argIndex ] );
}
}
@@ -582,7 +579,7 @@ int parseAndCallCommandLineTests( int argc, const char *argv[], cl_device_id dev
if( ret == EXIT_SUCCESS )
{
ret = callTestFunctions( fnList, fnNames, fnsToCall, num_fns, device, forceNoContextCreation, num_elements, queueProps );
ret = callTestFunctions( testList, selectedTestList, testNum, device, forceNoContextCreation, num_elements, queueProps );
if( gTestsFailed == 0 )
{
@@ -610,30 +607,30 @@ int parseAndCallCommandLineTests( int argc, const char *argv[], cl_device_id dev
test_finish();
free( fnsToCall );
free( selectedTestList );
return ret;
}
int callTestFunctions( basefn functionList[], const char *functionNames[], unsigned char functionsToCall[],
int numFunctions, cl_device_id deviceToUse, int forceNoContextCreation,
int callTestFunctions( test_definition testList[], unsigned char selectedTestList[],
int testNum, cl_device_id deviceToUse, int forceNoContextCreation,
int numElementsToUse, cl_command_queue_properties queueProps )
{
int numErrors = 0;
for( int i = 0; i < numFunctions; ++i )
for( int i = 0; i < testNum; ++i )
{
if( functionsToCall[ i ] )
if( selectedTestList[i] )
{
/* Skip any unimplemented tests. */
if( functionList[ i ] != NULL )
if( testList[i].func != NULL )
{
numErrors += callSingleTestFunction( functionList[ i ], functionNames[ i ], deviceToUse,
forceNoContextCreation, numElementsToUse, queueProps );
numErrors += callSingleTestFunction( testList[i], deviceToUse, forceNoContextCreation,
numElementsToUse, queueProps );
}
else
{
log_info( "%s test currently not implemented\n", functionNames[ i ] );
log_info( "%s test currently not implemented\n", testList[i].name );
}
}
}
@@ -647,9 +644,8 @@ void CL_CALLBACK notify_callback(const char *errinfo, const void *private_info,
}
// Actual function execution
int callSingleTestFunction( basefn functionToCall, const char *functionName,
cl_device_id deviceToUse, int forceNoContextCreation,
int numElementsToUse, cl_command_queue_properties queueProps )
int callSingleTestFunction( test_definition test, cl_device_id deviceToUse, int forceNoContextCreation,
int numElementsToUse, cl_command_queue_properties queueProps )
{
int numErrors = 0, ret;
cl_int error;
@@ -675,26 +671,26 @@ int callSingleTestFunction( basefn functionToCall, const char *functionName,
}
/* Run the test and print the result */
log_info( "%s...\n", functionName );
log_info( "%s...\n", test.name );
fflush( stdout );
ret = functionToCall( deviceToUse, context, queue, numElementsToUse); //test_threaded_function( ptr_basefn_list[i], group, context, num_elements);
ret = test.func( deviceToUse, context, queue, numElementsToUse); //test_threaded_function( ptr_basefn_list[i], group, context, num_elements);
if( ret == TEST_NOT_IMPLEMENTED )
{
/* Tests can also let us know they're not implemented yet */
log_info("%s test currently not implemented\n\n", functionName);
log_info("%s test currently not implemented\n\n", test.name);
}
else
{
/* Print result */
if( ret == 0 ) {
log_info( "%s passed\n", functionName );
log_info( "%s passed\n", test.name );
gTestsPassed++;
}
else
{
numErrors++;
log_error( "%s FAILED\n", functionName );
log_error( "%s FAILED\n", test.name );
gTestsFailed++;
}
}

View File

@@ -23,6 +23,17 @@
extern "C" {
#endif
#define ADD_TEST(fn) {test_##fn, #fn}
#define NOT_IMPLEMENTED_TEST(fn) {NULL, #fn}
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
typedef struct test_definition
{
basefn func;
const char* name;
} test_definition;
typedef enum test_status
{
TEST_PASS = 0,
@@ -35,39 +46,36 @@ extern cl_uint gRandomSeed;
// Supply a list of functions to test here. This will allocate a CL device, create a context, all that
// setup work, and then call each function in turn as dictatated by the passed arguments.
extern int runTestHarness( int argc, const char *argv[], unsigned int num_fns,
basefn fnList[], const char *fnNames[],
int imageSupportRequired, int forceNoContextCreation, cl_command_queue_properties queueProps );
extern int runTestHarness(int argc, const char *argv[], int testNum, test_definition testList[],
int imageSupportRequired, int forceNoContextCreation, cl_command_queue_properties queueProps );
// Device checking function. See runTestHarnessWithCheck. If this function returns anything other than TEST_PASS, the harness exits.
typedef test_status (*DeviceCheckFn)( cl_device_id device );
// Same as runTestHarness, but also supplies a function that checks the created device for required functionality.
extern int runTestHarnessWithCheck( int argc, const char *argv[], unsigned int num_fns,
basefn fnList[], const char *fnNames[],
int imageSupportRequired, int forceNoContextCreation, cl_command_queue_properties queueProps, DeviceCheckFn deviceCheckFn );
extern int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_definition testList[],
int imageSupportRequired, int forceNoContextCreation, cl_command_queue_properties queueProps,
DeviceCheckFn deviceCheckFn );
// The command line parser used by runTestHarness to break up parameters into calls to callTestFunctions
extern int parseAndCallCommandLineTests( int argc, const char *argv[], cl_device_id device, unsigned int num_fns,
basefn *fnList, const char *fnNames[],
int forceNoContextCreation, cl_command_queue_properties queueProps, int num_elements );
extern int parseAndCallCommandLineTests( int argc, const char *argv[], cl_device_id device, int testNum,
test_definition testList[], int forceNoContextCreation,
cl_command_queue_properties queueProps, int num_elements );
// Call this function if you need to do all the setup work yourself, and just need the function list called/
// managed.
// functionList is the actual array of functions
// functionNames is an array of strings representing the name of each function
// functionsToCall is an array of integers (treated as bools) which tell which function is to be called,
// each element at index i, corresponds to the element in functionList at index i
// numFunctions is the number of elements in the arrays
// testList is the data structure that contains test functions and its names
// selectedTestList is an array of integers (treated as bools) which tell which function is to be called,
// each element at index i, corresponds to the element in testList at index i
// testNum is the number of tests in testList and selectedTestList
// contextProps are used to create a testing context for each test
// deviceToUse and numElementsToUse are all just passed to each test function
extern int callTestFunctions( basefn functionList[], const char *functionNames[], unsigned char functionsToCall[],
int numFunctions, cl_device_id deviceToUse, int forceNoContextCreation,
extern int callTestFunctions( test_definition testList[], unsigned char selectedTestList[],
int testNum, cl_device_id deviceToUse, int forceNoContextCreation,
int numElementsToUse, cl_command_queue_properties queueProps );
// This function is called by callTestFunctions, once per function, to do setup, call, logging and cleanup
extern int callSingleTestFunction( basefn functionToCall, const char *functionName,
cl_device_id deviceToUse, int forceNoContextCreation,
extern int callSingleTestFunction( test_definition test, cl_device_id deviceToUse, int forceNoContextCreation,
int numElementsToUse, cl_command_queue_properties queueProps );
///// Miscellaneous steps

View File

@@ -30,187 +30,96 @@
cl_device_type gDeviceType = CL_DEVICE_TYPE_DEFAULT;
bool gTestRounding = false;
basefn basefn_list[] = {
test_get_platform_info,
test_get_sampler_info,
test_get_command_queue_info,
test_get_context_info,
test_get_device_info,
test_enqueue_task,
test_binary_get,
test_program_binary_create,
test_kernel_required_group_size,
test_definition test_list[] = {
ADD_TEST( get_platform_info ),
ADD_TEST( get_sampler_info ),
ADD_TEST( get_command_queue_info ),
ADD_TEST( get_context_info ),
ADD_TEST( get_device_info ),
ADD_TEST( enqueue_task ),
ADD_TEST( binary_get ),
ADD_TEST( binary_create ),
ADD_TEST( kernel_required_group_size ),
test_release_kernel_order,
test_release_during_execute,
ADD_TEST( release_kernel_order ),
ADD_TEST( release_during_execute ),
test_load_single_kernel,
test_load_two_kernels,
test_load_two_kernels_in_one,
test_load_two_kernels_manually,
test_get_program_info_kernel_names,
test_get_kernel_arg_info,
test_create_kernels_in_program,
test_get_kernel_info,
test_execute_kernel_local_sizes,
test_set_kernel_arg_by_index,
test_set_kernel_arg_constant,
test_set_kernel_arg_struct_array,
test_kernel_global_constant,
ADD_TEST( load_single_kernel ),
ADD_TEST( load_two_kernels ),
ADD_TEST( load_two_kernels_in_one ),
ADD_TEST( load_two_kernels_manually ),
ADD_TEST( get_program_info_kernel_names ),
ADD_TEST( get_kernel_arg_info ),
ADD_TEST( create_kernels_in_program ),
ADD_TEST( get_kernel_info ),
ADD_TEST( execute_kernel_local_sizes ),
ADD_TEST( set_kernel_arg_by_index ),
ADD_TEST( set_kernel_arg_constant ),
ADD_TEST( set_kernel_arg_struct_array ),
ADD_TEST( kernel_global_constant ),
test_min_max_thread_dimensions,
test_min_max_work_items_sizes,
test_min_max_work_group_size,
test_min_max_read_image_args,
test_min_max_write_image_args,
test_min_max_mem_alloc_size,
test_min_max_image_2d_width,
test_min_max_image_2d_height,
test_min_max_image_3d_width,
test_min_max_image_3d_height,
test_min_max_image_3d_depth,
test_min_max_image_array_size,
test_min_max_image_buffer_size,
test_min_max_parameter_size,
test_min_max_samplers,
test_min_max_constant_buffer_size,
test_min_max_constant_args,
test_min_max_compute_units,
test_min_max_address_bits,
test_min_max_single_fp_config,
test_min_max_double_fp_config,
test_min_max_local_mem_size,
test_min_max_kernel_preferred_work_group_size_multiple,
test_min_max_execution_capabilities,
test_min_max_queue_properties,
test_min_max_device_version,
test_min_max_language_version,
ADD_TEST( min_max_thread_dimensions ),
ADD_TEST( min_max_work_items_sizes ),
ADD_TEST( min_max_work_group_size ),
ADD_TEST( min_max_read_image_args ),
ADD_TEST( min_max_write_image_args ),
ADD_TEST( min_max_mem_alloc_size ),
ADD_TEST( min_max_image_2d_width ),
ADD_TEST( min_max_image_2d_height ),
ADD_TEST( min_max_image_3d_width ),
ADD_TEST( min_max_image_3d_height ),
ADD_TEST( min_max_image_3d_depth ),
ADD_TEST( min_max_image_array_size ),
ADD_TEST( min_max_image_buffer_size ),
ADD_TEST( min_max_parameter_size ),
ADD_TEST( min_max_samplers ),
ADD_TEST( min_max_constant_buffer_size ),
ADD_TEST( min_max_constant_args ),
ADD_TEST( min_max_compute_units ),
ADD_TEST( min_max_address_bits ),
ADD_TEST( min_max_single_fp_config ),
ADD_TEST( min_max_double_fp_config ),
ADD_TEST( min_max_local_mem_size ),
ADD_TEST( min_max_kernel_preferred_work_group_size_multiple ),
ADD_TEST( min_max_execution_capabilities ),
ADD_TEST( min_max_queue_properties ),
ADD_TEST( min_max_device_version ),
ADD_TEST( min_max_language_version ),
test_kernel_arg_changes,
test_kernel_arg_multi_setup_random,
ADD_TEST( kernel_arg_changes ),
ADD_TEST( kernel_arg_multi_setup_random ),
test_native_kernel,
ADD_TEST( native_kernel ),
test_create_context_from_type,
ADD_TEST( create_context_from_type ),
test_platform_extensions,
test_get_platform_ids,
test_for_bool_type,
ADD_TEST( platform_extensions ),
ADD_TEST( get_platform_ids ),
ADD_TEST( bool_type ),
test_repeated_setup_cleanup,
ADD_TEST( repeated_setup_cleanup ),
test_retain_queue_single,
test_retain_queue_multiple,
test_retain_mem_object_single,
test_retain_mem_object_multiple,
test_min_data_type_align_size_alignment,
ADD_TEST( retain_queue_single ),
ADD_TEST( retain_queue_multiple ),
ADD_TEST( retain_mem_object_single ),
ADD_TEST( retain_mem_object_multiple ),
ADD_TEST( min_data_type_align_size_alignment ),
test_mem_object_destructor_callback,
test_null_buffer_arg,
test_get_buffer_info,
test_get_image2d_info,
test_get_image3d_info,
test_get_image1d_info,
test_get_image1d_array_info,
test_get_image2d_array_info,
test_queue_properties,
ADD_TEST( mem_object_destructor_callback ),
ADD_TEST( null_buffer_arg ),
ADD_TEST( get_buffer_info ),
ADD_TEST( get_image2d_info ),
ADD_TEST( get_image3d_info ),
ADD_TEST( get_image1d_info ),
ADD_TEST( get_image1d_array_info ),
ADD_TEST( get_image2d_array_info ),
ADD_TEST( queue_properties ),
};
const char *basefn_names[] = {
"get_platform_info",
"get_sampler_info",
"get_command_queue_info",
"get_context_info",
"get_device_info",
"enqueue_task",
"binary_get",
"binary_create",
"kernel_required_group_size",
"release_kernel_order",
"release_during_execute",
"load_single_kernel",
"load_two_kernels",
"load_two_kernels_in_one",
"load_two_kernels_manually",
"get_program_info_kernel_names",
"get_kernel_arg_info",
"create_kernels_in_program",
"get_kernel_info",
"execute_kernel_local_sizes",
"set_kernel_arg_by_index",
"set_kernel_arg_constant",
"set_kernel_arg_struct_array",
"kernel_global_constant",
"min_max_thread_dimensions",
"min_max_work_items_sizes",
"min_max_work_group_size",
"min_max_read_image_args",
"min_max_write_image_args",
"min_max_mem_alloc_size",
"min_max_image_2d_width",
"min_max_image_2d_height",
"min_max_image_3d_width",
"min_max_image_3d_height",
"min_max_image_3d_depth",
"min_max_image_array_size",
"min_max_image_buffer_size",
"min_max_parameter_size",
"min_max_samplers",
"min_max_constant_buffer_size",
"min_max_constant_args",
"min_max_compute_units",
"min_max_address_bits",
"min_max_single_fp_config",
"min_max_double_fp_config",
"min_max_local_mem_size",
"min_max_kernel_preferred_work_group_size_multiple",
"min_max_execution_capabilities",
"min_max_queue_properties",
"min_max_device_version",
"min_max_language_version",
"kernel_arg_changes",
"kernel_arg_multi_setup_random",
"native_kernel",
"create_context_from_type",
"platform_extensions",
"get_platform_ids",
"bool_type",
"repeated_setup_cleanup",
"retain_queue_single",
"retain_queue_multiple",
"retain_mem_object_single",
"retain_mem_object_multiple",
"min_data_type_align_size_alignment",
"mem_object_destructor_callback",
"null_buffer_arg",
"get_buffer_info",
"get_image2d_info",
"get_image3d_info",
"get_image1d_info",
"get_image1d_array_info",
"get_image2d_array_info",
"queue_properties",
};
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[])
{
return runTestHarness( argc, argv, num_fns, basefn_list, basefn_names, false, false, 0 );
return runTestHarness( argc, argv, test_num, test_list, false, false, 0 );
}

View File

@@ -29,7 +29,7 @@ extern int test_create_kernels_in_program(cl_device_id deviceID, cl_conte
extern int test_enqueue_task(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_repeated_setup_cleanup(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_for_bool_type(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_bool_type(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_platform_extensions(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_get_platform_info(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_get_sampler_info(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
@@ -39,7 +39,7 @@ extern int test_get_device_info(cl_device_id deviceID, cl_context context
extern int test_kernel_required_group_size(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_binary_get(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_program_binary_create(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_binary_create(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_release_kernel_order(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_release_during_execute(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);

View File

@@ -75,7 +75,7 @@ int test_binary_get(cl_device_id deviceID, cl_context context, cl_command_queue
}
int test_program_binary_create(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
int test_binary_create(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
/* To test this in a self-contained fashion, we have to create a program with
source, then get the binary, then use that binary to reload the program, and then verify */

View File

@@ -35,8 +35,7 @@ const char *kernel_with_bool[] = {
"}\n"
};
int test_for_bool_type(cl_device_id deviceID, cl_context context,
cl_command_queue queue, int num_elements)
int test_bool_type(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
cl_program program;

View File

@@ -30,234 +30,118 @@
cl_device_type gDeviceType = CL_DEVICE_TYPE_DEFAULT;
bool gTestRounding = false;
basefn basefn_list[] = {
test_hostptr,
test_fpmath_float,
test_fpmath_float2,
test_fpmath_float4,
test_intmath_int,
test_intmath_int2,
test_intmath_int4,
test_intmath_long,
test_intmath_long2,
test_intmath_long4,
test_hiloeo,
test_if,
test_sizeof,
test_loop,
test_pointer_cast,
test_local_arg_def,
test_local_kernel_def,
test_local_kernel_scope,
test_constant,
test_constant_source,
test_readimage,
test_readimage_int16,
test_readimage_fp32,
test_writeimage,
test_writeimage_int16,
test_writeimage_fp32,
test_multireadimageonefmt,
test_definition test_list[] = {
ADD_TEST( hostptr ),
ADD_TEST( fpmath_float ),
ADD_TEST( fpmath_float2 ),
ADD_TEST( fpmath_float4 ),
ADD_TEST( intmath_int ),
ADD_TEST( intmath_int2 ),
ADD_TEST( intmath_int4 ),
ADD_TEST( intmath_long ),
ADD_TEST( intmath_long2 ),
ADD_TEST( intmath_long4 ),
ADD_TEST( hiloeo ),
ADD_TEST( if ),
ADD_TEST( sizeof ),
ADD_TEST( loop ),
ADD_TEST( pointer_cast ),
ADD_TEST( local_arg_def ),
ADD_TEST( local_kernel_def ),
ADD_TEST( local_kernel_scope ),
ADD_TEST( constant ),
ADD_TEST( constant_source ),
ADD_TEST( readimage ),
ADD_TEST( readimage_int16 ),
ADD_TEST( readimage_fp32 ),
ADD_TEST( writeimage ),
ADD_TEST( writeimage_int16 ),
ADD_TEST( writeimage_fp32 ),
ADD_TEST( mri_one ),
test_multireadimagemultifmt,
test_image_r8,
test_barrier,
test_int2float,
test_float2int,
test_imagereadwrite,
test_imagereadwrite3d,
test_readimage3d,
test_readimage3d_int16,
test_readimage3d_fp32,
test_bufferreadwriterect,
test_arrayreadwrite,
test_arraycopy,
test_imagearraycopy,
test_imagearraycopy3d,
test_imagecopy,
test_imagecopy3d,
test_imagerandomcopy,
test_arrayimagecopy,
test_arrayimagecopy3d,
test_imagenpot,
ADD_TEST( mri_multiple ),
ADD_TEST( image_r8 ),
ADD_TEST( barrier ),
ADD_TEST( int2float ),
ADD_TEST( float2int ),
ADD_TEST( imagereadwrite ),
ADD_TEST( imagereadwrite3d ),
ADD_TEST( readimage3d ),
ADD_TEST( readimage3d_int16 ),
ADD_TEST( readimage3d_fp32 ),
ADD_TEST( bufferreadwriterect ),
ADD_TEST( arrayreadwrite ),
ADD_TEST( arraycopy ),
ADD_TEST( imagearraycopy ),
ADD_TEST( imagearraycopy3d ),
ADD_TEST( imagecopy ),
ADD_TEST( imagecopy3d ),
ADD_TEST( imagerandomcopy ),
ADD_TEST( arrayimagecopy ),
ADD_TEST( arrayimagecopy3d ),
ADD_TEST( imagenpot ),
test_vload_global,
test_vload_local,
test_vload_constant,
test_vload_private,
test_vstore_global,
test_vstore_local,
test_vstore_private,
ADD_TEST( vload_global ),
ADD_TEST( vload_local ),
ADD_TEST( vload_constant ),
ADD_TEST( vload_private ),
ADD_TEST( vstore_global ),
ADD_TEST( vstore_local ),
ADD_TEST( vstore_private ),
test_createkernelsinprogram,
test_imagedim_pow2,
test_imagedim_non_pow2,
test_image_param,
test_image_multipass_integer_coord,
test_image_multipass_float_coord,
test_explicit_s2v_bool,
test_explicit_s2v_char,
test_explicit_s2v_uchar,
test_explicit_s2v_short,
test_explicit_s2v_ushort,
test_explicit_s2v_int,
test_explicit_s2v_uint,
test_explicit_s2v_long,
test_explicit_s2v_ulong,
test_explicit_s2v_float,
test_explicit_s2v_double,
ADD_TEST( createkernelsinprogram ),
ADD_TEST( imagedim_pow2 ),
ADD_TEST( imagedim_non_pow2 ),
ADD_TEST( image_param ),
ADD_TEST( image_multipass_integer_coord ),
ADD_TEST( image_multipass_float_coord ),
ADD_TEST( explicit_s2v_bool ),
ADD_TEST( explicit_s2v_char ),
ADD_TEST( explicit_s2v_uchar ),
ADD_TEST( explicit_s2v_short ),
ADD_TEST( explicit_s2v_ushort ),
ADD_TEST( explicit_s2v_int ),
ADD_TEST( explicit_s2v_uint ),
ADD_TEST( explicit_s2v_long ),
ADD_TEST( explicit_s2v_ulong ),
ADD_TEST( explicit_s2v_float ),
ADD_TEST( explicit_s2v_double ),
test_enqueue_map_buffer,
test_enqueue_map_image,
ADD_TEST( enqueue_map_buffer ),
ADD_TEST( enqueue_map_image ),
test_work_item_functions,
ADD_TEST( work_item_functions ),
test_astype,
ADD_TEST( astype ),
test_async_copy_global_to_local,
test_async_copy_local_to_global,
test_async_strided_copy_global_to_local,
test_async_strided_copy_local_to_global,
test_prefetch,
ADD_TEST( async_copy_global_to_local ),
ADD_TEST( async_copy_local_to_global ),
ADD_TEST( async_strided_copy_global_to_local ),
ADD_TEST( async_strided_copy_local_to_global ),
ADD_TEST( prefetch ),
test_kernel_call_kernel_function,
test_host_numeric_constants,
test_kernel_numeric_constants,
test_kernel_limit_constants,
test_kernel_preprocessor_macros,
ADD_TEST( kernel_call_kernel_function ),
ADD_TEST( host_numeric_constants ),
ADD_TEST( kernel_numeric_constants ),
ADD_TEST( kernel_limit_constants ),
ADD_TEST( kernel_preprocessor_macros ),
test_basic_parameter_types,
test_vector_creation,
test_vec_type_hint,
test_kernel_memory_alignment_local,
test_kernel_memory_alignment_global,
test_kernel_memory_alignment_constant,
test_kernel_memory_alignment_private,
ADD_TEST( parameter_types ),
ADD_TEST( vector_creation ),
ADD_TEST( vec_type_hint ),
ADD_TEST( kernel_memory_alignment_local ),
ADD_TEST( kernel_memory_alignment_global ),
ADD_TEST( kernel_memory_alignment_constant ),
ADD_TEST( kernel_memory_alignment_private ),
test_global_work_offsets,
test_get_global_offset
ADD_TEST( global_work_offsets ),
ADD_TEST( get_global_offset ),
};
const char *basefn_names[] = {
"hostptr",
"fpmath_float",
"fpmath_float2",
"fpmath_float4",
"intmath_int",
"intmath_int2",
"intmath_int4",
"intmath_long",
"intmath_long2",
"intmath_long4",
"hiloeo",
"if",
"sizeof",
"loop",
"pointer_cast",
"local_arg_def",
"local_kernel_def",
"local_kernel_scope",
"constant",
"constant_source",
"readimage",
"readimage_int16",
"readimage_fp32",
"writeimage",
"writeimage_int16",
"writeimage_fp32",
"mri_one",
"mri_multiple",
"image_r8",
"barrier",
"int2float",
"float2int",
"imagereadwrite",
"imagereadwrite3d",
"readimage3d",
"readimage3d_int16",
"readimage3d_fp32",
"bufferreadwriterect",
"arrayreadwrite",
"arraycopy",
"imagearraycopy",
"imagearraycopy3d",
"imagecopy",
"imagecopy3d",
"imagerandomcopy",
"arrayimagecopy",
"arrayimagecopy3d",
"imagenpot",
"vload_global",
"vload_local",
"vload_constant",
"vload_private",
"vstore_global",
"vstore_local",
"vstore_private",
"createkernelsinprogram",
"imagedim_pow2",
"imagedim_non_pow2",
"image_param",
"image_multipass_integer_coord",
"image_multipass_float_coord",
"explicit_s2v_bool",
"explicit_s2v_char",
"explicit_s2v_uchar",
"explicit_s2v_short",
"explicit_s2v_ushort",
"explicit_s2v_int",
"explicit_s2v_uint",
"explicit_s2v_long",
"explicit_s2v_ulong",
"explicit_s2v_float",
"explicit_s2v_double",
"enqueue_map_buffer",
"enqueue_map_image",
"work_item_functions",
"astype",
"async_copy_global_to_local",
"async_copy_local_to_global",
"async_strided_copy_global_to_local",
"async_strided_copy_local_to_global",
"prefetch",
"kernel_call_kernel_function",
"host_numeric_constants",
"kernel_numeric_constants",
"kernel_limit_constants",
"kernel_preprocessor_macros",
"parameter_types",
"vector_creation",
"vec_type_hint",
"kernel_memory_alignment_local",
"kernel_memory_alignment_global",
"kernel_memory_alignment_constant",
"kernel_memory_alignment_private",
"global_work_offsets",
"get_global_offset",
};
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[])
{
int err = runTestHarness( argc, argv, num_fns, basefn_list, basefn_names, false, false, 0 );
return err;
return runTestHarness( argc, argv, test_num, test_list, false, false, 0 );
}

View File

@@ -48,8 +48,8 @@ extern int test_readimage_fp32(cl_device_id deviceID, cl_context context, c
extern int test_writeimage(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_writeimage_int16(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_writeimage_fp32(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_multireadimageonefmt(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_multireadimagemultifmt(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_mri_one(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_mri_multiple(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_image_r8(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_simplebarrier(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_barrier(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
@@ -125,7 +125,7 @@ extern int test_kernel_preprocessor_macros(cl_device_id deviceID, cl_context
extern int test_kernel_call_kernel_function(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_basic_parameter_types(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements);
extern int test_parameter_types(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements);
extern int test_vector_creation(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_vec_type_hint(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);

View File

@@ -45,8 +45,7 @@ const char *kernel_code_long =
" result[1] = %s(ul);\n"
"}\n";
int
test_basic_parameter_types_long(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
int test_parameter_types_long(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
{
clMemWrapper results;
int error;
@@ -157,10 +156,9 @@ test_basic_parameter_types_long(cl_device_id device, cl_context context, cl_comm
return total_errors;
}
int
test_basic_parameter_types(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
int test_parameter_types(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
{
clMemWrapper results;
clMemWrapper results;
int error;
size_t global[3] = {1, 1, 1};
float results_back[7*16];
@@ -289,7 +287,7 @@ test_basic_parameter_types(cl_device_id device, cl_context context, cl_command_q
if (gHasLong) {
log_info("Testing long types...\n");
total_errors += test_basic_parameter_types_long( device, context, queue, num_elements );
total_errors += test_parameter_types_long( device, context, queue, num_elements );
}
else {
log_info("Longs unsupported, skipping.");

View File

@@ -110,7 +110,7 @@ verify_multireadimage(void *image[], float *outptr, int w, int h)
int
test_multireadimagemultifmt(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
test_mri_multiple(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
{
cl_mem streams[4];
cl_image_format img_format;

View File

@@ -92,7 +92,7 @@ verify_multireadimage(void *image[], int num_images, float *outptr, int w, int h
}
int test_multireadimageonefmt(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
int test_mri_one(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
{
cl_mem streams[8];
cl_image_format img_format;

View File

@@ -24,145 +24,76 @@
#include <unistd.h>
#endif
basefn basefn_list[] = {
test_load_program_source,
test_load_multistring_source,
test_load_two_kernel_source,
test_load_null_terminated_source,
test_load_null_terminated_multi_line_source,
test_load_null_terminated_partial_multi_line_source,
test_load_discreet_length_source,
test_get_program_source,
test_get_program_build_info,
test_get_program_info,
test_definition test_list[] = {
ADD_TEST( load_program_source ),
ADD_TEST( load_multistring_source ),
ADD_TEST( load_two_kernel_source ),
ADD_TEST( load_null_terminated_source ),
ADD_TEST( load_null_terminated_multi_line_source ),
ADD_TEST( load_null_terminated_partial_multi_line_source ),
ADD_TEST( load_discreet_length_source ),
ADD_TEST( get_program_source ),
ADD_TEST( get_program_build_info ),
ADD_TEST( get_program_info ),
test_large_compile,
test_async_build_pieces,
ADD_TEST( large_compile ),
ADD_TEST( async_build ),
test_options_optimizations,
test_options_build_macro,
test_options_build_macro_existence,
test_options_include_directory,
test_options_denorm_cache,
ADD_TEST( options_build_optimizations ),
ADD_TEST( options_build_macro ),
ADD_TEST( options_build_macro_existence ),
ADD_TEST( options_include_directory ),
ADD_TEST( options_denorm_cache ),
test_preprocessor_define_udef,
test_preprocessor_include,
test_preprocessor_line_error,
test_preprocessor_pragma,
ADD_TEST( preprocessor_define_udef ),
ADD_TEST( preprocessor_include ),
ADD_TEST( preprocessor_line_error ),
ADD_TEST( preprocessor_pragma ),
test_compiler_defines_for_extensions,
test_image_macro,
ADD_TEST( compiler_defines_for_extensions ),
ADD_TEST( image_macro ),
test_simple_compile_only,
test_simple_static_compile_only,
test_simple_extern_compile_only,
test_simple_compile_with_callback,
test_simple_embedded_header_compile,
test_simple_link_only,
test_two_file_regular_variable_access,
test_two_file_regular_struct_access,
test_two_file_regular_function_access,
test_simple_link_with_callback,
test_simple_embedded_header_link,
test_execute_after_simple_compile_and_link,
test_execute_after_simple_compile_and_link_no_device_info,
test_execute_after_simple_compile_and_link_with_defines,
test_execute_after_simple_compile_and_link_with_callbacks,
test_execute_after_simple_library_with_link,
test_execute_after_two_file_link,
test_execute_after_embedded_header_link,
test_execute_after_included_header_link,
test_execute_after_serialize_reload_object,
test_execute_after_serialize_reload_library,
test_simple_library_only,
test_simple_library_with_callback,
test_simple_library_with_link,
test_two_file_link,
test_multi_file_libraries,
test_multiple_files,
test_multiple_libraries,
test_multiple_files_multiple_libraries,
test_multiple_embedded_headers,
ADD_TEST( simple_compile_only ),
ADD_TEST( simple_static_compile_only ),
ADD_TEST( simple_extern_compile_only ),
ADD_TEST( simple_compile_with_callback ),
ADD_TEST( simple_embedded_header_compile ),
ADD_TEST( simple_link_only ),
ADD_TEST( two_file_regular_variable_access ),
ADD_TEST( two_file_regular_struct_access ),
ADD_TEST( two_file_regular_function_access ),
ADD_TEST( simple_link_with_callback ),
ADD_TEST( simple_embedded_header_link ),
ADD_TEST( execute_after_simple_compile_and_link ),
ADD_TEST( execute_after_simple_compile_and_link_no_device_info ),
ADD_TEST( execute_after_simple_compile_and_link_with_defines ),
ADD_TEST( execute_after_simple_compile_and_link_with_callbacks ),
ADD_TEST( execute_after_simple_library_with_link ),
ADD_TEST( execute_after_two_file_link ),
ADD_TEST( execute_after_embedded_header_link ),
ADD_TEST( execute_after_included_header_link ),
ADD_TEST( execute_after_serialize_reload_object ),
ADD_TEST( execute_after_serialize_reload_library ),
ADD_TEST( simple_library_only ),
ADD_TEST( simple_library_with_callback ),
ADD_TEST( simple_library_with_link ),
ADD_TEST( two_file_link ),
ADD_TEST( multi_file_libraries ),
ADD_TEST( multiple_files ),
ADD_TEST( multiple_libraries ),
ADD_TEST( multiple_files_multiple_libraries ),
ADD_TEST( multiple_embedded_headers ),
test_program_binary_type,
test_compile_and_link_status_options_log,
ADD_TEST( program_binary_type ),
ADD_TEST( compile_and_link_status_options_log ),
test_pragma_unroll
ADD_TEST( pragma_unroll ),
};
const char *basefn_names[] = {
"load_program_source",
"load_multistring_source",
"load_two_kernel_source",
"load_null_terminated_source",
"load_null_terminated_multi_line_source",
"load_null_terminated_partial_multi_line_source",
"load_discreet_length_source",
"get_program_source",
"get_program_build_info",
"get_program_info",
"large_compile",
"async_build",
"options_build_optimizations",
"options_build_macro",
"options_build_macro_existence",
"options_include_directory",
"options_denorm_cache",
"preprocessor_define_udef",
"preprocessor_include",
"preprocessor_line_error",
"preprocessor_pragma",
"compiler_defines_for_extensions",
"image_macro",
"simple_compile_only",
"simple_static_compile_only",
"simple_extern_compile_only",
"simple_compile_with_callback",
"simple_embedded_header_compile",
"simple_link_only",
"two_file_regular_variable_access",
"two_file_regular_struct_access",
"two_file_regular_function_access",
"simple_link_with_callback",
"simple_embedded_header_link",
"execute_after_simple_compile_and_link",
"execute_after_simple_compile_and_link_no_device_info",
"execute_after_simple_compile_and_link_with_defines",
"execute_after_simple_compile_and_link_with_callbacks",
"execute_after_simple_library_with_link",
"execute_after_two_file_link",
"execute_after_embedded_header_link",
"execute_after_included_header_link",
"execute_after_serialize_reload_object",
"execute_after_serialize_reload_library",
"simple_library_only",
"simple_library_with_callback",
"simple_library_with_link",
"two_file_link",
"multi_file_libraries",
"multiple_files",
"multiple_libraries",
"multiple_files_multiple_libraries",
"multiple_embedded_headers",
"program_binary_type",
"compile_and_link_status_options_log",
"pragma_unroll",
};
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[])
{
return runTestHarness( argc, argv, num_fns, basefn_list, basefn_names, false, false, 0 );
return runTestHarness( argc, argv, test_num, test_list, false, false, 0 );
}

View File

@@ -31,9 +31,9 @@ extern int test_get_program_build_info(cl_device_id deviceID, cl_context
extern int test_get_program_info(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_large_compile(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_async_build_pieces(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_async_build(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_options_optimizations(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_options_build_optimizations(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_options_build_macro(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_options_build_macro_existence(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_options_include_directory(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
@@ -85,4 +85,4 @@ extern int test_multiple_embedded_headers(cl_device_id deviceID, cl_context
extern int test_program_binary_type(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_compile_and_link_status_options_log(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_pragma_unroll(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_pragma_unroll(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);

View File

@@ -43,7 +43,7 @@ void CL_CALLBACK test_notify_build_complete( cl_program program, void *userData
log_info( "\n <-- program successfully built\n" );
}
int test_async_build_pieces(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
int test_async_build(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
int error;
cl_program program;

View File

@@ -90,7 +90,7 @@ cl_int get_result_from_program( cl_context context, cl_command_queue queue, cl_p
return CL_SUCCESS;
}
int test_options_optimizations(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
int test_options_build_optimizations(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
int error;
cl_build_status status;

View File

@@ -847,17 +847,11 @@ int test_computeinfo( cl_device_id deviceID, cl_context context, cl_command_queu
return total_errors;
}
basefn basefn_list[] = {
test_computeinfo,
test_definition test_list[] = {
ADD_TEST( computeinfo ),
};
const char *basefn_names[] = {
"computeinfo",
};
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)
{
@@ -884,6 +878,6 @@ int main(int argc, const char** argv)
}
}
return runTestHarness( argCount, argList, num_fns, basefn_list, basefn_names, false, true, 0 );
return runTestHarness( argCount, argList, test_num, test_list, false, true, 0 );
}

View File

@@ -300,47 +300,26 @@ int test_contractions_double_7(cl_device_id deviceID, cl_context context, cl_com
return RunTest_Double(7);
}
basefn basefn_list[] = {
test_contractions_float_0,
test_contractions_float_1,
test_contractions_float_2,
test_contractions_float_3,
test_contractions_float_4,
test_contractions_float_5,
test_contractions_float_6,
test_contractions_float_7,
test_contractions_double_0,
test_contractions_double_1,
test_contractions_double_2,
test_contractions_double_3,
test_contractions_double_4,
test_contractions_double_5,
test_contractions_double_6,
test_contractions_double_7,
test_definition test_list[] = {
ADD_TEST( contractions_float_0 ),
ADD_TEST( contractions_float_1 ),
ADD_TEST( contractions_float_2 ),
ADD_TEST( contractions_float_3 ),
ADD_TEST( contractions_float_4 ),
ADD_TEST( contractions_float_5 ),
ADD_TEST( contractions_float_6 ),
ADD_TEST( contractions_float_7 ),
ADD_TEST( contractions_double_0 ),
ADD_TEST( contractions_double_1 ),
ADD_TEST( contractions_double_2 ),
ADD_TEST( contractions_double_3 ),
ADD_TEST( contractions_double_4 ),
ADD_TEST( contractions_double_5 ),
ADD_TEST( contractions_double_6 ),
ADD_TEST( contractions_double_7 ),
};
const char *basefn_names[] = {
"contractions_float_0",
"contractions_float_1",
"contractions_float_2",
"contractions_float_3",
"contractions_float_4",
"contractions_float_5",
"contractions_float_6",
"contractions_float_7",
"contractions_double_0",
"contractions_double_1",
"contractions_double_2",
"contractions_double_3",
"contractions_double_4",
"contractions_double_5",
"contractions_double_6",
"contractions_double_7",
};
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 )
{
@@ -355,7 +334,7 @@ int main( int argc, const char **argv )
if( error )
goto exit;
error = parseAndCallCommandLineTests( gArgCount, gArgList, NULL, num_fns, basefn_list, basefn_names, true, 0, 0 );
error = parseAndCallCommandLineTests( gArgCount, gArgList, NULL, test_num, test_list, true, 0, 0 );
exit:
if( gQueue )
@@ -564,9 +543,9 @@ static void PrintUsage( void )
vlog( "\t\t-sNUMBER set random seed.\n");
vlog( "\n" );
vlog( "\tTest names:\n" );
for( int i = 0; i < num_fns; i++ )
for( int i = 0; i < test_num; i++ )
{
vlog( "\t\t%s\n", basefn_names[i] );
vlog( "\t\t%s\n", test_list[i].name );
}
}

View File

@@ -278,17 +278,11 @@ exit:
return gFailCount;
}
basefn basefn_list[] = {
test_conversions,
test_definition test_list[] = {
ADD_TEST( conversions ),
};
const char *basefn_names[] = {
"test_conversions",
};
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 );
#pragma mark -
@@ -327,7 +321,7 @@ int main (int argc, const char **argv )
vlog( "Random seed: %u\n", seed );
gMTdata = init_genrand( seed );
int ret = parseAndCallCommandLineTests( 1, NULL, NULL, num_fns, basefn_list, basefn_names, true, 0, 0 );
int ret = parseAndCallCommandLineTests( 1, NULL, NULL, test_num, test_list, true, 0, 0 );
free_mtdata( gMTdata );

View File

@@ -27,43 +27,23 @@
std::string gKernelName;
int gWimpyMode = 0;
basefn basefn_list[] =
{
test_definition test_list[] = {
#ifdef CL_VERSION_2_0
test_device_info,
test_device_queue,
test_execute_block,
test_enqueue_block,
test_enqueue_nested_blocks,
test_enqueue_wg_size,
test_enqueue_flags,
test_enqueue_multi_queue,
test_host_multi_queue,
test_enqueue_ndrange,
test_host_queue_order,
ADD_TEST( device_info ),
ADD_TEST( device_queue ),
ADD_TEST( execute_block ),
ADD_TEST( enqueue_block ),
ADD_TEST( enqueue_nested_blocks ),
ADD_TEST( enqueue_wg_size ),
ADD_TEST( enqueue_flags ),
ADD_TEST( enqueue_multi_queue ),
ADD_TEST( host_multi_queue ),
ADD_TEST( enqueue_ndrange ),
ADD_TEST( host_queue_order ),
#endif
};
const char *commonfn_names[] =
{
#ifdef CL_VERSION_2_0
"test_device_info",
"test_device_queue",
"test_execute_block",
"test_enqueue_block",
"test_enqueue_nested_blocks",
"test_enqueue_wg_size",
"test_enqueue_flags",
"test_enqueue_multi_queue",
"test_host_multi_queue",
"test_enqueue_ndrange",
"test_host_queue_order",
#endif
};
ct_assert(arr_size(commonfn_names) == arr_size(basefn_list))
static const int num_commonfns = arr_size(commonfn_names);
const int test_num = ARRAY_SIZE( test_list );
test_status deviceCheck(cl_device_id device)
{
@@ -93,8 +73,7 @@ test_status deviceCheck(cl_device_id device)
return TEST_PASS;
}
int
main(int argc, const char *argv[])
int main(int argc, const char *argv[])
{
for (int i = 0; i < argc; ++i) {
int argsRemoveNum = 0;
@@ -122,5 +101,5 @@ main(int argc, const char *argv[])
}
}
return runTestHarnessWithCheck(argc, argv, num_commonfns, basefn_list, commonfn_names, false, false, 0, deviceCheck);
return runTestHarnessWithCheck(argc, argv, test_num, test_list, false, false, 0, deviceCheck);
}

View File

@@ -25,36 +25,21 @@
#include <unistd.h>
#endif
basefn basefn_list[] = {
test_partition_equally,
test_partition_by_counts,
test_partition_by_affinity_domain_numa,
test_partition_by_affinity_domain_l4_cache,
test_partition_by_affinity_domain_l3_cache,
test_partition_by_affinity_domain_l2_cache,
test_partition_by_affinity_domain_l1_cache,
test_partition_by_affinity_domain_next_partitionable,
test_partition
test_definition test_list[] = {
ADD_TEST( partition_equally ),
ADD_TEST( partition_by_counts ),
ADD_TEST( partition_by_affinity_domain_numa ),
ADD_TEST( partition_by_affinity_domain_l4_cache ),
ADD_TEST( partition_by_affinity_domain_l3_cache ),
ADD_TEST( partition_by_affinity_domain_l2_cache ),
ADD_TEST( partition_by_affinity_domain_l1_cache ),
ADD_TEST( partition_by_affinity_domain_next_partitionable ),
ADD_TEST( partition_all ),
};
const char *basefn_names[] = {
"device_partition_equally",
"device_partition_by_counts",
"device_partition_by_affinity_domain_numa",
"device_partition_by_affinity_domain_l4_cache",
"device_partition_by_affinity_domain_l3_cache",
"device_partition_by_affinity_domain_l2_cache",
"device_partition_by_affinity_domain_l1_cache",
"device_partition_by_affinity_domain_next_partitionable",
"device_partition_all",
};
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[])
{
return runTestHarness( argc, argv, num_fns, basefn_list, basefn_names, false, true, 0 );
return runTestHarness( argc, argv, test_num, test_list, false, true, 0 );
}

View File

@@ -18,7 +18,7 @@
#include "../../test_common/harness/typeWrappers.h"
#include "../../test_common/harness/mt19937.h"
extern int test_partition(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_partition_all(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_partition_equally(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_partition_by_counts(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_partition_by_affinity_domain_numa(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);

View File

@@ -583,7 +583,7 @@ int test_partition_by_affinity_domain_next_partitionable(cl_device_id deviceID,
return test_partition_of_device(deviceID, context, queue, num_elements, NULL, 7, 8);
}
int test_partition(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
int test_partition_all(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
return test_partition_of_device(deviceID, context, queue, num_elements, NULL, 0, 8);
}

View File

@@ -23,86 +23,45 @@
#include <unistd.h>
#endif
basefn basefn_list[] = {
test_event_get_execute_status,
test_event_get_write_array_status,
test_event_get_read_array_status,
test_event_get_info,
test_event_wait_for_execute,
test_event_wait_for_array,
test_event_flush,
test_event_finish_execute,
test_event_finish_array,
test_event_release_before_done,
test_event_enqueue_marker,
#ifdef CL_VERSION_1_2
test_event_enqueue_marker_with_list,
test_event_enqueue_barrier_with_list,
#endif
test_event_waitlist_single_queue,
test_event_waitlist_multi_queue,
test_event_waitlist_multi_queue_multi_device,
test_event_enqueue_wait_for_events_single_queue,
test_event_enqueue_wait_for_events_multi_queue,
test_event_enqueue_wait_for_events_multi_queue_multi_device,
test_event_enqueue_marker_single_queue,
test_event_enqueue_marker_multi_queue,
test_event_enqueue_marker_multi_queue_multi_device,
test_event_enqueue_barrier_single_queue,
test_waitlists,
test_userevents,
test_callbacks,
test_callbacks_simultaneous,
test_userevents_multithreaded,
};
const char *basefn_names[] = {
"event_get_execute_status",
"event_get_write_array_status",
"event_get_read_array_status",
"event_get_info",
"event_wait_for_execute",
"event_wait_for_array",
"event_flush",
"event_finish_execute",
"event_finish_array",
"event_release_before_done",
"event_enqueue_marker",
test_definition test_list[] = {
ADD_TEST( event_get_execute_status ),
ADD_TEST( event_get_write_array_status ),
ADD_TEST( event_get_read_array_status ),
ADD_TEST( event_get_info ),
ADD_TEST( event_wait_for_execute ),
ADD_TEST( event_wait_for_array ),
ADD_TEST( event_flush ),
ADD_TEST( event_finish_execute ),
ADD_TEST( event_finish_array ),
ADD_TEST( event_release_before_done ),
ADD_TEST( event_enqueue_marker ),
#ifdef CL_VERSION_1_2
"event_enqueue_marker_with_event_list",
"event_enqueue_barrier_with_event_list",
ADD_TEST( event_enqueue_marker_with_event_list ),
ADD_TEST( event_enqueue_barrier_with_event_list ),
#endif
"out_of_order_event_waitlist_single_queue",
"out_of_order_event_waitlist_multi_queue",
"out_of_order_event_waitlist_multi_queue_multi_device",
"out_of_order_event_enqueue_wait_for_events_single_queue",
"out_of_order_event_enqueue_wait_for_events_multi_queue",
"out_of_order_event_enqueue_wait_for_events_multi_queue_multi_device",
"out_of_order_event_enqueue_marker_single_queue",
"out_of_order_event_enqueue_marker_multi_queue",
"out_of_order_event_enqueue_marker_multi_queue_multi_device",
"out_of_order_event_enqueue_barrier_single_queue",
ADD_TEST( out_of_order_event_waitlist_single_queue ),
ADD_TEST( out_of_order_event_waitlist_multi_queue ),
ADD_TEST( out_of_order_event_waitlist_multi_queue_multi_device ),
ADD_TEST( out_of_order_event_enqueue_wait_for_events_single_queue ),
ADD_TEST( out_of_order_event_enqueue_wait_for_events_multi_queue ),
ADD_TEST( out_of_order_event_enqueue_wait_for_events_multi_queue_multi_device ),
ADD_TEST( out_of_order_event_enqueue_marker_single_queue ),
ADD_TEST( out_of_order_event_enqueue_marker_multi_queue ),
ADD_TEST( out_of_order_event_enqueue_marker_multi_queue_multi_device ),
ADD_TEST( out_of_order_event_enqueue_barrier_single_queue ),
"waitlists",
"test_userevents",
"callbacks",
"callbacks_simultaneous",
"userevents_multithreaded",
ADD_TEST( waitlists ),
ADD_TEST( userevents ),
ADD_TEST( callbacks ),
ADD_TEST( callbacks_simultaneous ),
ADD_TEST( userevents_multithreaded ),
};
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[])
{
return runTestHarness( argc, argv, num_fns, basefn_list, basefn_names, false, false, 0 );
return runTestHarness( argc, argv, test_num, test_list, false, false, 0 );
}

View File

@@ -34,23 +34,23 @@ extern int test_event_finish_array(cl_device_id deviceID, cl_context cont
extern int test_event_release_before_done(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_event_enqueue_marker(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
#ifdef CL_VERSION_1_2
extern int test_event_enqueue_marker_with_list(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_event_enqueue_barrier_with_list(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_event_enqueue_marker_with_event_list(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_event_enqueue_barrier_with_event_list(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
#endif
extern int test_event_waitlist_single_queue(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_event_waitlist_multi_queue( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_event_waitlist_multi_queue_multi_device(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_out_of_order_event_waitlist_single_queue(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_out_of_order_event_waitlist_multi_queue( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_out_of_order_event_waitlist_multi_queue_multi_device(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_event_enqueue_wait_for_events_single_queue(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_event_enqueue_wait_for_events_multi_queue( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_event_enqueue_wait_for_events_multi_queue_multi_device(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_out_of_order_event_enqueue_wait_for_events_single_queue(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_out_of_order_event_enqueue_wait_for_events_multi_queue( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_out_of_order_event_enqueue_wait_for_events_multi_queue_multi_device(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_event_enqueue_barrier_single_queue(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_out_of_order_event_enqueue_barrier_single_queue(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_event_enqueue_marker_single_queue(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_event_enqueue_marker_multi_queue( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_event_enqueue_marker_multi_queue_multi_device(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_out_of_order_event_enqueue_marker_single_queue(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_out_of_order_event_enqueue_marker_multi_queue( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_out_of_order_event_enqueue_marker_multi_queue_multi_device(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_waitlists( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
extern int test_userevents( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );

View File

@@ -389,7 +389,7 @@ int test( cl_device_id deviceID, cl_context context, cl_command_queue queue, int
}
int test_event_waitlist_single_queue( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
int test_out_of_order_event_waitlist_single_queue( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
int two_queues = 0;
int two_devices = 0;
@@ -400,7 +400,7 @@ int test_event_waitlist_single_queue( cl_device_id deviceID, cl_context context,
return test(deviceID, context, queue, num_elements, two_queues, two_devices, test_enqueue_wait_for_events, test_barrier, use_waitlists, use_marker);
}
int test_event_waitlist_multi_queue( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
int test_out_of_order_event_waitlist_multi_queue( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
int two_queues = 1;
int two_devices = 0;
@@ -411,7 +411,7 @@ int test_event_waitlist_multi_queue( cl_device_id deviceID, cl_context context,
return test(deviceID, context, queue, num_elements, two_queues, two_devices, test_enqueue_wait_for_events, test_barrier, use_waitlists, use_marker);
}
int test_event_waitlist_multi_queue_multi_device( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
int test_out_of_order_event_waitlist_multi_queue_multi_device( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
int two_queues = 1;
int two_devices = 1;
@@ -423,7 +423,7 @@ int test_event_waitlist_multi_queue_multi_device( cl_device_id deviceID, cl_cont
}
int test_event_enqueue_wait_for_events_single_queue( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
int test_out_of_order_event_enqueue_wait_for_events_single_queue( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
int two_queues = 0;
int two_devices = 0;
@@ -434,7 +434,7 @@ int test_event_enqueue_wait_for_events_single_queue( cl_device_id deviceID, cl_c
return test(deviceID, context, queue, num_elements, two_queues, two_devices, test_enqueue_wait_for_events, test_barrier, use_waitlists, use_marker);
}
int test_event_enqueue_wait_for_events_multi_queue( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
int test_out_of_order_event_enqueue_wait_for_events_multi_queue( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
int two_queues = 1;
int two_devices = 0;
@@ -446,7 +446,7 @@ int test_event_enqueue_wait_for_events_multi_queue( cl_device_id deviceID, cl_co
}
int test_event_enqueue_wait_for_events_multi_queue_multi_device( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
int test_out_of_order_event_enqueue_wait_for_events_multi_queue_multi_device( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
int two_queues = 1;
int two_devices = 1;
@@ -460,7 +460,7 @@ int test_event_enqueue_wait_for_events_multi_queue_multi_device( cl_device_id de
int test_event_enqueue_barrier_single_queue( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
int test_out_of_order_event_enqueue_barrier_single_queue( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
int two_queues = 0;
int two_devices = 0;
@@ -472,7 +472,7 @@ int test_event_enqueue_barrier_single_queue( cl_device_id deviceID, cl_context c
}
int test_event_enqueue_marker_single_queue( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
int test_out_of_order_event_enqueue_marker_single_queue( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
int two_queues = 0;
int two_devices = 0;
@@ -483,7 +483,7 @@ int test_event_enqueue_marker_single_queue( cl_device_id deviceID, cl_context co
return test(deviceID, context, queue, num_elements, two_queues, two_devices, test_enqueue_wait_for_events, test_barrier, use_waitlists, use_marker);
}
int test_event_enqueue_marker_multi_queue( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
int test_out_of_order_event_enqueue_marker_multi_queue( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
int two_queues = 1;
int two_devices = 0;
@@ -495,7 +495,7 @@ int test_event_enqueue_marker_multi_queue( cl_device_id deviceID, cl_context con
}
int test_event_enqueue_marker_multi_queue_multi_device( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
int test_out_of_order_event_enqueue_marker_multi_queue_multi_device( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
int two_queues = 1;
int two_devices = 1;

View File

@@ -590,7 +590,7 @@ int test_event_enqueue_marker( cl_device_id deviceID, cl_context context, cl_com
}
#ifdef CL_VERSION_1_2
int test_event_enqueue_marker_with_list( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
int test_event_enqueue_marker_with_event_list( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
cl_int status;
@@ -634,10 +634,8 @@ int test_event_enqueue_marker_with_list( cl_device_id deviceID, cl_context conte
FINISH_EVENT(queue);
return 0;
}
#endif
#ifdef CL_VERSION_1_2
int test_event_enqueue_barrier_with_list( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
int test_event_enqueue_barrier_with_event_list( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
cl_int status;

View File

@@ -92,7 +92,7 @@ private:
const std::vector<std::string> _kernels;
};
int test_function_params_get_fence(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) {
int test_function_get_fence(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) {
const std::string KERNEL_FUNCTION = common::CONFORMANCE_VERIFY_FENCE +
NL
NL "__global int gint = 1;"
@@ -140,7 +140,7 @@ int test_function_params_get_fence(cl_device_id deviceID, cl_context context, cl
return test.Execute(deviceID, context, queue, num_elements);
}
int test_function_params_to_address_space(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) {
int test_function_to_address_space(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) {
const std::string KERNEL_FUNCTION =
NL
NL "__global int gint = 1;"

View File

@@ -18,8 +18,8 @@
#include <iostream>
// basic tests
extern int test_function_params_get_fence(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_function_params_to_address_space(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_function_get_fence(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_function_to_address_space(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_variable_get_fence(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_variable_to_address_space(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_casting(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
@@ -40,59 +40,32 @@ extern int test_generic_advanced_casting(cl_device_id deviceID, cl_context conte
extern int test_generic_ptr_to_host_mem(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_max_number_of_params(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
basefn basefn_list[] = {
test_definition test_list[] = {
// basic tests
test_function_params_get_fence,
test_function_params_to_address_space,
test_variable_get_fence,
test_variable_to_address_space,
test_casting,
test_conditional_casting,
test_chain_casting,
test_ternary_operator_casting,
test_language_struct,
test_language_union,
test_multiple_calls_same_function,
test_compare_pointers,
ADD_TEST( function_get_fence ),
ADD_TEST( function_to_address_space ),
ADD_TEST( variable_get_fence ),
ADD_TEST( variable_to_address_space ),
ADD_TEST( casting ),
ADD_TEST( conditional_casting ),
ADD_TEST( chain_casting ),
ADD_TEST( ternary_operator_casting ),
ADD_TEST( language_struct ),
ADD_TEST( language_union ),
ADD_TEST( multiple_calls_same_function ),
ADD_TEST( compare_pointers ),
// advanced tests
test_library_function,
test_generic_variable_volatile,
test_generic_variable_const,
test_generic_variable_gentype,
test_builtin_functions,
test_generic_advanced_casting,
test_generic_ptr_to_host_mem,
test_max_number_of_params,
ADD_TEST( library_function ),
ADD_TEST( generic_variable_volatile ),
ADD_TEST( generic_variable_const ),
ADD_TEST( generic_variable_gentype ),
ADD_TEST( builtin_functions ),
ADD_TEST( generic_advanced_casting ),
ADD_TEST( generic_ptr_to_host_mem ),
ADD_TEST( max_number_of_params ),
};
const char *basefn_names[] = {
//basic tests
"function_get_fence",
"function_to_address_space",
"variable_get_fence",
"variable_to_address_space",
"casting",
"conditional_casting",
"chain_casting",
"ternary_operator_casting",
"language_struct",
"language_union",
"multiple_calls_same_function",
"compare_pointers",
// advanced tests
"library_function",
"generic_variable_volatile",
"generic_variable_const",
"generic_variable_gentype",
"builtin_functions",
"generic_advanced_casting",
"generic_ptr_to_host_mem",
"max_number_of_params",
};
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 );
/*
Generic Address Space
@@ -102,5 +75,5 @@ int num_fns = sizeof(basefn_names) / sizeof(char *);
int main(int argc, const char *argv[])
{
return runTestHarness(argc, argv, num_fns, basefn_list, basefn_names, false, false, NULL);
return runTestHarness(argc, argv, test_num, test_list, false, false, NULL);
}

View File

@@ -23,39 +23,21 @@
#include <unistd.h>
#endif
basefn basefn_list[] = {
test_geom_cross,
test_geom_dot,
test_geom_distance,
test_geom_fast_distance,
test_geom_length,
test_geom_fast_length,
test_geom_normalize,
test_geom_fast_normalize
test_definition test_list[] = {
ADD_TEST( geom_cross ),
ADD_TEST( geom_dot ),
ADD_TEST( geom_distance ),
ADD_TEST( geom_fast_distance ),
ADD_TEST( geom_length ),
ADD_TEST( geom_fast_length ),
ADD_TEST( geom_normalize ),
ADD_TEST( geom_fast_normalize ),
};
const char *basefn_names[] = {
"geom_cross",
"geom_dot",
"geom_distance",
"geom_fast_distance",
"geom_length",
"geom_fast_length",
"geom_normalize",
"geom_fast_normalize",
};
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 unsigned int g_vecSizeof[] = {0,1,2,4,4,0,0,0,8,
0,0,0,0,0,0,0,16};
const int test_num = ARRAY_SIZE( test_list );
int main(int argc, const char *argv[])
{
return runTestHarness( argc, argv, num_fns, basefn_list, basefn_names, false, false, 0 );
return runTestHarness( argc, argv, test_num, test_list, false, false, 0 );
}

View File

@@ -18,8 +18,6 @@
#include "../../test_common/harness/threadTesting.h"
#include "../../test_common/harness/typeWrappers.h"
extern const unsigned int g_vecSizeof[];
extern int create_program_and_kernel(const char *source, const char *kernel_name, cl_program *program_ret, cl_kernel *kernel_ret);
extern int test_geom_cross(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);

View File

@@ -33,177 +33,108 @@
static cl_context sCurrentContext = NULL;
#define TEST_FN_REDIRECT( fn ) redirect_##fn
#define TEST_FN_REDIRECT( fn ) ADD_TEST( redirect_##fn )
#define TEST_FN_REDIRECTOR( fn ) \
int redirect_##fn(cl_device_id device, cl_context context, cl_command_queue queue, int numElements ) \
int test_redirect_##fn(cl_device_id device, cl_context context, cl_command_queue queue, int numElements ) \
{ \
int error; \
clCommandQueueWrapper realQueue = clCreateCommandQueueWithProperties( sCurrentContext, device, 0, &error ); \
test_error( error, "Unable to create command queue" ); \
return fn( device, sCurrentContext, realQueue, numElements ); \
return test_##fn( device, sCurrentContext, realQueue, numElements ); \
}
// buffers:
TEST_FN_REDIRECTOR( test_buffers )
TEST_FN_REDIRECTOR( test_buffers_getinfo )
TEST_FN_REDIRECTOR( buffers )
TEST_FN_REDIRECTOR( buffers_getinfo )
// 1D images:
TEST_FN_REDIRECTOR( test_images_read_1D )
TEST_FN_REDIRECTOR( test_images_write_1D )
TEST_FN_REDIRECTOR( test_images_1D_getinfo )
TEST_FN_REDIRECTOR( images_read_1D )
TEST_FN_REDIRECTOR( images_write_1D )
TEST_FN_REDIRECTOR( images_1D_getinfo )
// 1D image arrays:
TEST_FN_REDIRECTOR( test_images_read_1Darray )
TEST_FN_REDIRECTOR( test_images_write_1Darray )
TEST_FN_REDIRECTOR( test_images_1Darray_getinfo )
TEST_FN_REDIRECTOR( images_read_1Darray )
TEST_FN_REDIRECTOR( images_write_1Darray )
TEST_FN_REDIRECTOR( images_1Darray_getinfo )
// 2D images:
TEST_FN_REDIRECTOR( test_images_read_2D )
TEST_FN_REDIRECTOR( test_images_read_cube )
TEST_FN_REDIRECTOR( test_images_write )
TEST_FN_REDIRECTOR( test_images_write_cube )
TEST_FN_REDIRECTOR( test_images_2D_getinfo )
TEST_FN_REDIRECTOR( test_images_cube_getinfo )
TEST_FN_REDIRECTOR( images_read_2D )
TEST_FN_REDIRECTOR( images_read_cube )
TEST_FN_REDIRECTOR( images_write )
TEST_FN_REDIRECTOR( images_write_cube )
TEST_FN_REDIRECTOR( images_2D_getinfo )
TEST_FN_REDIRECTOR( images_cube_getinfo )
// 2D image arrays:
TEST_FN_REDIRECTOR( test_images_read_2Darray )
TEST_FN_REDIRECTOR( test_images_write_2Darray )
TEST_FN_REDIRECTOR( test_images_2Darray_getinfo )
TEST_FN_REDIRECTOR( images_read_2Darray )
TEST_FN_REDIRECTOR( images_write_2Darray )
TEST_FN_REDIRECTOR( images_2Darray_getinfo )
// 3D images:
TEST_FN_REDIRECTOR( test_images_read_3D )
TEST_FN_REDIRECTOR( test_images_write_3D )
TEST_FN_REDIRECTOR( test_images_3D_getinfo )
TEST_FN_REDIRECTOR( images_read_3D )
TEST_FN_REDIRECTOR( images_write_3D )
TEST_FN_REDIRECTOR( images_3D_getinfo )
#ifdef GL_VERSION_3_2
TEST_FN_REDIRECTOR( test_images_read_texturebuffer )
TEST_FN_REDIRECTOR( test_images_write_texturebuffer )
TEST_FN_REDIRECTOR( test_images_texturebuffer_getinfo )
TEST_FN_REDIRECTOR( images_read_texturebuffer )
TEST_FN_REDIRECTOR( images_write_texturebuffer )
TEST_FN_REDIRECTOR( images_texturebuffer_getinfo )
// depth textures
TEST_FN_REDIRECTOR( test_images_read_2D_depth )
TEST_FN_REDIRECTOR( test_images_write_2D_depth )
TEST_FN_REDIRECTOR( test_images_read_2Darray_depth )
TEST_FN_REDIRECTOR( test_images_write_2Darray_depth )
TEST_FN_REDIRECTOR( images_read_2D_depth )
TEST_FN_REDIRECTOR( images_write_2D_depth )
TEST_FN_REDIRECTOR( images_read_2Darray_depth )
TEST_FN_REDIRECTOR( images_write_2Darray_depth )
TEST_FN_REDIRECTOR( test_images_read_2D_multisample )
TEST_FN_REDIRECTOR( test_images_read_2Darray_multisample )
TEST_FN_REDIRECTOR( test_image_methods_depth );
TEST_FN_REDIRECTOR( test_image_methods_multisample );
TEST_FN_REDIRECTOR( images_read_2D_multisample )
TEST_FN_REDIRECTOR( images_read_2Darray_multisample )
TEST_FN_REDIRECTOR( image_methods_depth )
TEST_FN_REDIRECTOR( image_methods_multisample )
#endif
// Renderbuffer-backed images:
TEST_FN_REDIRECTOR( test_renderbuffer_read )
TEST_FN_REDIRECTOR( test_renderbuffer_write )
TEST_FN_REDIRECTOR( test_renderbuffer_getinfo )
TEST_FN_REDIRECTOR( renderbuffer_read )
TEST_FN_REDIRECTOR( renderbuffer_write )
TEST_FN_REDIRECTOR( renderbuffer_getinfo )
TEST_FN_REDIRECTOR( test_fence_sync )
basefn basefn_list[] = {
TEST_FN_REDIRECT( test_buffers ),
TEST_FN_REDIRECT( test_buffers_getinfo ),
test_definition test_list[] = {
TEST_FN_REDIRECT( buffers ),
TEST_FN_REDIRECT( buffers_getinfo ),
TEST_FN_REDIRECT( test_images_read_1D ),
TEST_FN_REDIRECT( test_images_write_1D ),
TEST_FN_REDIRECT( test_images_1D_getinfo ),
TEST_FN_REDIRECT( images_read_1D ),
TEST_FN_REDIRECT( images_write_1D ),
TEST_FN_REDIRECT( images_1D_getinfo ),
TEST_FN_REDIRECT( test_images_read_1Darray ),
TEST_FN_REDIRECT( test_images_write_1Darray ),
TEST_FN_REDIRECT( test_images_1Darray_getinfo ),
TEST_FN_REDIRECT( images_read_1Darray ),
TEST_FN_REDIRECT( images_write_1Darray ),
TEST_FN_REDIRECT( images_1Darray_getinfo ),
TEST_FN_REDIRECT( test_images_read_2D ),
TEST_FN_REDIRECT( test_images_write ),
TEST_FN_REDIRECT( test_images_2D_getinfo ),
TEST_FN_REDIRECT( images_read_2D ),
TEST_FN_REDIRECT( images_write ),
TEST_FN_REDIRECT( images_2D_getinfo ),
TEST_FN_REDIRECT( test_images_read_cube ),
TEST_FN_REDIRECT( test_images_write_cube ),
TEST_FN_REDIRECT( test_images_cube_getinfo ),
TEST_FN_REDIRECT( images_read_cube ),
TEST_FN_REDIRECT( images_write_cube ),
TEST_FN_REDIRECT( images_cube_getinfo ),
TEST_FN_REDIRECT( test_images_read_2Darray ),
TEST_FN_REDIRECT( test_images_write_2Darray),
TEST_FN_REDIRECT( test_images_2Darray_getinfo ),
TEST_FN_REDIRECT( images_read_2Darray ),
TEST_FN_REDIRECT( images_write_2Darray),
TEST_FN_REDIRECT( images_2Darray_getinfo ),
TEST_FN_REDIRECT( test_images_read_3D ),
TEST_FN_REDIRECT( test_images_write_3D ),
TEST_FN_REDIRECT( test_images_3D_getinfo ),
TEST_FN_REDIRECT( images_read_3D ),
TEST_FN_REDIRECT( images_write_3D ),
TEST_FN_REDIRECT( images_3D_getinfo ),
TEST_FN_REDIRECT( test_renderbuffer_read ),
TEST_FN_REDIRECT( test_renderbuffer_write ),
TEST_FN_REDIRECT( test_renderbuffer_getinfo )
TEST_FN_REDIRECT( renderbuffer_read ),
TEST_FN_REDIRECT( renderbuffer_write ),
TEST_FN_REDIRECT( renderbuffer_getinfo )
};
basefn basefn_list32[] = {
TEST_FN_REDIRECT( test_images_read_texturebuffer ),
TEST_FN_REDIRECT( test_images_write_texturebuffer ),
TEST_FN_REDIRECT( test_images_texturebuffer_getinfo ),
TEST_FN_REDIRECT( test_fence_sync ),
TEST_FN_REDIRECT( test_images_read_2D_depth ),
TEST_FN_REDIRECT( test_images_write_2D_depth ),
TEST_FN_REDIRECT( test_images_read_2Darray_depth ),
TEST_FN_REDIRECT( test_images_write_2Darray_depth ),
TEST_FN_REDIRECT( test_images_read_2D_multisample ),
TEST_FN_REDIRECT( test_images_read_2Darray_multisample ),
TEST_FN_REDIRECT( test_image_methods_depth ),
TEST_FN_REDIRECT( test_image_methods_multisample)
};
const char *basefn_names[] = {
"buffers",
"buffers_getinfo",
"images_read_1D",
"images_write_1D",
"images_1D_getinfo",
"images_read_1Darray",
"images_write_1Darray",
"images_1Darray_getinfo",
"images_read", /* 2D */
"images_write",
"images_2D_getinfo",
"images_read_cube",
"images_write_cube",
"images_cube_getinfo",
"images_read_2Darray",
"images_write_2Darray",
"images_2Darray_getinfo",
"images_read_3D",
"images_write_3D",
"images_3D_getinfo",
"renderbuffer_read",
"renderbuffer_write",
"renderbuffer_getinfo",
};
const char *basefn_names32[] = {
"images_read_texturebuffer",
"images_write_texturebuffer",
"images_texturebuffer_getinfo",
"fence_sync",
"images_read_2D_depth",
"images_write_2D_depth",
"images_read_2D_array_depth",
"images_write_2D_array_depth",
"images_read_2D_multisample",
"images_read_2D_array_multisample",
"image_methods_depth",
"image_methods_multisample",
};
ct_assert((sizeof(basefn_names) / sizeof(basefn_names[0])) == (sizeof(basefn_list) / sizeof(basefn_list[0])));
ct_assert((sizeof(basefn_names32) / sizeof(basefn_names32[0])) == (sizeof(basefn_list32) / sizeof(basefn_list32[0])));
int num_fns = sizeof(basefn_names) / sizeof(char *);
int num_fns32 = sizeof(basefn_names32) / sizeof(char *);
const int test_num = ARRAY_SIZE( test_list );
const int test_num32 = ARRAY_SIZE( test_list32 );
cl_device_type gDeviceType = CL_DEVICE_TYPE_DEFAULT;
bool gTestRounding = true;
@@ -246,12 +177,12 @@ int main(int argc, const char *argv[])
if( argc > 1 && strcmp( argv[ 1 ], "-list" ) == 0 )
{
log_info( "Available 2.x tests:\n" );
for( int i = 0; i < num_fns; i++ )
log_info( "\t%s\n", basefn_names[ i ] );
for( int i = 0; i < test_num; i++ )
log_info( "\t%s\n", test_list[i].name );
log_info( "Available 3.2 tests:\n" );
for( int i = 0; i < num_fns32; i++ )
log_info( "\t%s\n", basefn_names32[ i ] );
for( int i = 0; i < test_num32; i++ )
log_info( "\t%s\n", test_list32[i].name );
log_info( "Note: Any 3.2 test names must follow 2.1 test names on the command line.\n" );
log_info( "Use environment variables to specify desired device.\n" );
@@ -264,8 +195,8 @@ int main(int argc, const char *argv[])
unsigned first_32_testname = 0;
for (int j=1; (j<argc) && (!first_32_testname); ++j)
for (int i=0;i<num_fns32;++i)
if (strcmp(basefn_names32[i],argv[j])==0) {
for (int i = 0; i < test_num32; ++i)
if (strcmp(test_list32[i].name, argv[j]) == 0) {
first_32_testname = j;
break;
}
@@ -352,7 +283,7 @@ int main(int argc, const char *argv[])
}
// Note: don't use the entire harness, because we have a different way of obtaining the device (via the context)
error = parseAndCallCommandLineTests( argc_, argv, deviceIDs[ i ], num_fns, basefn_list, basefn_names, true, 0, 1024 );
error = parseAndCallCommandLineTests( argc_, argv, deviceIDs[i], test_num, test_list, true, 0, 1024 );
if( error != 0 )
break;
}
@@ -425,7 +356,7 @@ int main(int argc, const char *argv[])
}
// Note: don't use the entire harness, because we have a different way of obtaining the device (via the context)
error = parseAndCallCommandLineTests( argc_, argv_, deviceIDs[ i ], num_fns32, basefn_list32, basefn_names32, true, 0, 1024 );
error = parseAndCallCommandLineTests( argc_, argv_, deviceIDs[i], test_num32, test_list32, true, 0, 1024 );
if( error != 0 )
break;
}
@@ -443,4 +374,3 @@ int main(int argc, const char *argv[])
return numErrors;
}

View File

@@ -38,80 +38,58 @@
static cl_context sCurrentContext = NULL;
#define TEST_FN_REDIRECT( fn ) redirect_##fn
#define TEST_FN_REDIRECT( fn ) ADD_TEST( redirect_##fn )
#define TEST_FN_REDIRECTOR( fn ) \
int redirect_##fn(cl_device_id device, cl_context context, cl_command_queue queue, int numElements ) \
int test_redirect_##fn(cl_device_id device, cl_context context, cl_command_queue queue, int numElements ) \
{ \
int error; \
clCommandQueueWrapper realQueue = clCreateCommandQueue( sCurrentContext, device, 0, &error ); \
test_error( error, "Unable to create command queue" ); \
return fn( device, sCurrentContext, realQueue, numElements ); \
return test_##fn( device, sCurrentContext, realQueue, numElements ); \
}
TEST_FN_REDIRECTOR( test_buffers )
TEST_FN_REDIRECTOR( test_buffers_getinfo )
TEST_FN_REDIRECTOR( test_images_read )
TEST_FN_REDIRECTOR( test_images_2D_getinfo )
TEST_FN_REDIRECTOR( test_images_read_cube )
TEST_FN_REDIRECTOR( test_images_cube_getinfo )
TEST_FN_REDIRECTOR( test_images_read_3D )
TEST_FN_REDIRECTOR( test_images_3D_getinfo )
TEST_FN_REDIRECTOR( test_images_write )
TEST_FN_REDIRECTOR( test_images_write_cube )
TEST_FN_REDIRECTOR( test_renderbuffer_read )
TEST_FN_REDIRECTOR( test_renderbuffer_write )
TEST_FN_REDIRECTOR( test_renderbuffer_getinfo )
TEST_FN_REDIRECTOR( buffers )
TEST_FN_REDIRECTOR( buffers_getinfo )
TEST_FN_REDIRECTOR( images_read )
TEST_FN_REDIRECTOR( images_2D_getinfo )
TEST_FN_REDIRECTOR( images_read_cube )
TEST_FN_REDIRECTOR( images_cube_getinfo )
TEST_FN_REDIRECTOR( images_read_3D )
TEST_FN_REDIRECTOR( images_3D_getinfo )
TEST_FN_REDIRECTOR( images_write )
TEST_FN_REDIRECTOR( images_write_cube )
TEST_FN_REDIRECTOR( renderbuffer_read )
TEST_FN_REDIRECTOR( renderbuffer_write )
TEST_FN_REDIRECTOR( renderbuffer_getinfo )
#ifndef GL_ES_VERSION_2_0
TEST_FN_REDIRECTOR( test_fence_sync )
#endif
basefn basefn_list[] = {
TEST_FN_REDIRECT( test_buffers ),
TEST_FN_REDIRECT( test_buffers_getinfo ),
TEST_FN_REDIRECT( test_images_read ),
TEST_FN_REDIRECT( test_images_2D_getinfo ),
TEST_FN_REDIRECT( test_images_read_cube ),
TEST_FN_REDIRECT( test_images_cube_getinfo ),
TEST_FN_REDIRECT( test_images_read_3D ),
TEST_FN_REDIRECT( test_images_3D_getinfo ),
TEST_FN_REDIRECT( test_images_write ),
TEST_FN_REDIRECT( test_images_write_cube ),
TEST_FN_REDIRECT( test_renderbuffer_read ),
TEST_FN_REDIRECT( test_renderbuffer_write ),
TEST_FN_REDIRECT( test_renderbuffer_getinfo )
test_definition test_list[] = {
TEST_FN_REDIRECT( buffers ),
TEST_FN_REDIRECT( buffers_getinfo ),
TEST_FN_REDIRECT( images_read ),
TEST_FN_REDIRECT( images_2D_getinfo ),
TEST_FN_REDIRECT( images_read_cube ),
TEST_FN_REDIRECT( images_cube_getinfo ),
TEST_FN_REDIRECT( images_read_3D ),
TEST_FN_REDIRECT( images_3D_getinfo ),
TEST_FN_REDIRECT( images_write ),
TEST_FN_REDIRECT( images_write_cube ),
TEST_FN_REDIRECT( renderbuffer_read ),
TEST_FN_REDIRECT( renderbuffer_write ),
TEST_FN_REDIRECT( renderbuffer_getinfo )
};
#ifndef GL_ES_VERSION_2_0
basefn basefn_list32[] = {
TEST_FN_REDIRECT( test_fence_sync )
test_definition test_list32[] = {
TEST_FN_REDIRECT( fence_sync )
};
#endif
const char *basefn_names[] = {
"buffers",
"buffers_getinfo",
"images_read",
"images_2D_getinfo",
"images_read_cube",
"images_cube_getinfo",
"images_read_3D",
"images_3D_getinfo",
"images_write",
"images_write_cube",
"renderbuffer_read",
"renderbuffer_write",
"renderbuffer_getinfo"
};
const char *basefn_names32[] = {
"fence_sync"
};
ct_assert((sizeof(basefn_names) / sizeof(basefn_names[0])) == (sizeof(basefn_list) / sizeof(basefn_list[0])));
int num_fns = sizeof(basefn_names) / sizeof(char *);
int num_fns32 = sizeof(basefn_names32) / sizeof(char *);
const int test_num = ARRAY_SIZE( test_list );
const int test_num32 = ARRAY_SIZE( test_list32 );
int main(int argc, const char *argv[])
@@ -132,12 +110,12 @@ int main(int argc, const char *argv[])
if(strcmp( argv[ z ], "-list" ) == 0 )
{
log_info( "Available 2.x tests:\n" );
for( int i = 0; i < num_fns - 1; i++ )
log_info( "\t%s\n", basefn_names[ i ] );
for( int i = 0; i < test_num; i++ )
log_info( "\t%s\n", test_list[i].name );
log_info( "Available 3.2 tests:\n" );
for( int i = 0; i < num_fns32 - 1; i++ )
log_info( "\t%s\n", basefn_names32[ i ] );
for( int i = 0; i < test_num32; i++ )
log_info( "\t%s\n", test_list32[i].name );
log_info( "Note: Any 3.2 test names must follow 2.1 test names on the command line." );
log_info( "Use environment variables to specify desired device." );
@@ -166,8 +144,8 @@ int main(int argc, const char *argv[])
unsigned first_32_testname = 0;
for (int j=1; (j<argc) && (!first_32_testname); ++j)
for (int i=0;i<num_fns32-1;++i)
if (strcmp(basefn_names32[i],argv[j])==0) {
for (int i = 0; i < test_num32; ++i)
if (strcmp(test_list32[i].name, argv[j]) == 0 ) {
first_32_testname = j;
break;
}
@@ -290,7 +268,7 @@ int main(int argc, const char *argv[])
}
// Note: don't use the entire harness, because we have a different way of obtaining the device (via the context)
error = parseAndCallCommandLineTests( argc_tmp, argv_tmp, deviceIDs[ i ], num_fns, basefn_list, basefn_names, true, 0, 1024 );
error = parseAndCallCommandLineTests( argc_tmp, argv_tmp, deviceIDs[i], test_num, test_list, true, 0, 1024 );
if( error != 0 )
break;
}
@@ -367,7 +345,7 @@ int main(int argc, const char *argv[])
goto cleanup;
#else
// Note: don't use the entire harness, because we have a different way of obtaining the device (via the context)
error = parseAndCallCommandLineTests( argc_, argv_, deviceIDs[ i ], num_fns32, basefn_list32, basefn_names32, true, 0, 1024 );
error = parseAndCallCommandLineTests( argc_, argv_, deviceIDs[ i ], test_num32, test_list32, true, 0, 1024 );
if( error != 0 )
break;
#endif

View File

@@ -18,7 +18,7 @@
#include "tests.h"
#include "../../test_common/harness/testHarness.h"
int Test_roundTrip( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
int test_roundTrip( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
{
int vectorSize, error;
uint64_t i, j;

View File

@@ -617,12 +617,12 @@ exit:
return error;
}
int Test_vload_half( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
int test_vload_half( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
{
return Test_vLoadHalf_private( false );
}
int Test_vloada_half( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
int test_vloada_half( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
{
return Test_vLoadHalf_private( true );
}

View File

@@ -612,7 +612,7 @@ double2half_rtn( double f )
return (u.u >> (53-11)) | sign;
}
int Test_vstore_half( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
int test_vstore_half( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
{
switch (get_default_rounding_mode(gDevice))
{
@@ -625,27 +625,27 @@ int Test_vstore_half( cl_device_id deviceID, cl_context context, cl_command_queu
}
}
int Test_vstore_half_rte( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
int test_vstore_half_rte( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
{
return Test_vStoreHalf_private(float2half_rte, double2half_rte, "_rte");
}
int Test_vstore_half_rtz( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
int test_vstore_half_rtz( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
{
return Test_vStoreHalf_private(float2half_rtz, double2half_rtz, "_rtz");
}
int Test_vstore_half_rtp( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
int test_vstore_half_rtp( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
{
return Test_vStoreHalf_private(float2half_rtp, double2half_rtp, "_rtp");
}
int Test_vstore_half_rtn( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
int test_vstore_half_rtn( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
{
return Test_vStoreHalf_private(float2half_rtn, double2half_rtn, "_rtn");
}
int Test_vstorea_half( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
int test_vstorea_half( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
{
switch (get_default_rounding_mode(gDevice))
{
@@ -658,22 +658,22 @@ int Test_vstorea_half( cl_device_id deviceID, cl_context context, cl_command_que
}
}
int Test_vstorea_half_rte( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
int test_vstorea_half_rte( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
{
return Test_vStoreaHalf_private(float2half_rte, double2half_rte, "_rte");
}
int Test_vstorea_half_rtz( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
int test_vstorea_half_rtz( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
{
return Test_vStoreaHalf_private(float2half_rtz, double2half_rtz, "_rtz");
}
int Test_vstorea_half_rtp( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
int test_vstorea_half_rtp( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
{
return Test_vStoreaHalf_private(float2half_rtp, double2half_rtp, "_rtp");
}
int Test_vstorea_half_rtn( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
int test_vstorea_half_rtn( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
{
return Test_vStoreaHalf_private(float2half_rtn, double2half_rtn, "_rtn");
}

View File

@@ -55,41 +55,23 @@ int g_arrVecSizes[kVectorSizeCount+kStrangeVectorSizeCount];
int g_arrVecAligns[kLargestVectorSize+1];
static int arrStrangeVecSizes[kStrangeVectorSizeCount] = {3};
basefn basefn_list[] = {
Test_vload_half,
Test_vloada_half,
Test_vstore_half,
Test_vstorea_half,
Test_vstore_half_rte,
Test_vstorea_half_rte,
Test_vstore_half_rtz,
Test_vstorea_half_rtz,
Test_vstore_half_rtp,
Test_vstorea_half_rtp,
Test_vstore_half_rtn,
Test_vstorea_half_rtn,
Test_roundTrip,
test_definition test_list[] = {
ADD_TEST( vload_half ),
ADD_TEST( vloada_half ),
ADD_TEST( vstore_half ),
ADD_TEST( vstorea_half ),
ADD_TEST( vstore_half_rte ),
ADD_TEST( vstorea_half_rte ),
ADD_TEST( vstore_half_rtz ),
ADD_TEST( vstorea_half_rtz ),
ADD_TEST( vstore_half_rtp ),
ADD_TEST( vstorea_half_rtp ),
ADD_TEST( vstore_half_rtn ),
ADD_TEST( vstorea_half_rtn ),
ADD_TEST( roundTrip ),
};
const char *basefn_names[] = {
"vload_half",
"vloada_half",
"vstore_half",
"vstorea_half",
"vstore_half_rte",
"vstorea_half_rte",
"vstore_half_rtz",
"vstorea_half_rtz",
"vstore_half_rtp",
"vstorea_half_rtp",
"vstore_half_rtn",
"vstorea_half_rtn",
"roundTrip",
};
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 )
{
@@ -102,14 +84,14 @@ int main (int argc, const char **argv )
}
for(i = 0; i < kStrangeVectorSizeCount; ++i) {
g_arrVecSizes[i+kVectorSizeCount] =
arrStrangeVecSizes[i];
arrStrangeVecSizes[i];
}
for(i = 0, alignbound=1; i <= kLargestVectorSize; ++i) {
while(alignbound < i) {
alignbound = alignbound<<1;
}
g_arrVecAligns[i] = alignbound;
while(alignbound < i) {
alignbound = alignbound<<1;
}
g_arrVecAligns[i] = alignbound;
}
test_start();
@@ -128,7 +110,7 @@ int main (int argc, const char **argv )
}
fflush( stdout );
error = parseAndCallCommandLineTests( argCount, argList, NULL, num_fns, basefn_list, basefn_names, true, 0, 0 );
error = parseAndCallCommandLineTests( argCount, argList, NULL, test_num, test_list, true, 0, 0 );
exit:
if(gQueue)
@@ -318,9 +300,9 @@ static void PrintUsage( void )
vlog( "\t\t-w\tRun in wimpy mode\n" );
vlog( "\t\t-[2^n]\tSet wimpy reduction factor, recommended range of n is 1-12, default factor(%u)\n", gWimpyReductionFactor);
vlog( "\t\t-h\tHelp\n" );
for( int i = 0; i < num_fns; i++ )
for( int i = 0; i < test_num; i++ )
{
vlog("\t\t%s\n", basefn_names[i] );
vlog("\t\t%s\n", test_list[i].name );
}
}

View File

@@ -17,19 +17,19 @@
#define TESTS_H
int Test_vload_half( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
int Test_vloada_half( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
int Test_vstore_half( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
int Test_vstorea_half( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
int Test_vstore_half_rte( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
int Test_vstorea_half_rte( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
int Test_vstore_half_rtz( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
int Test_vstorea_half_rtz( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
int Test_vstore_half_rtp( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
int Test_vstorea_half_rtp( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
int Test_vstore_half_rtn( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
int Test_vstorea_half_rtn( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
int Test_roundTrip( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
int test_vload_half( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
int test_vloada_half( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
int test_vstore_half( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
int test_vstorea_half( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
int test_vstore_half_rte( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
int test_vstorea_half_rte( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
int test_vstore_half_rtz( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
int test_vstorea_half_rtz( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
int test_vstore_half_rtp( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
int test_vstorea_half_rtp( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
int test_vstore_half_rtn( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
int test_vstorea_half_rtn( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
int test_roundTrip( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
typedef cl_ushort (*f2h)( float );
typedef cl_ushort (*d2h)( double );

View File

@@ -636,39 +636,24 @@ int test_double( cl_device_id deviceID, cl_context context, cl_command_queue que
return 0;
}
basefn basefn_list[] = {
test_char,
test_uchar,
test_short,
test_ushort,
test_int,
test_uint,
test_long,
test_ulong,
test_float,
test_double,
test_definition test_list[] = {
ADD_TEST( char ),
ADD_TEST( uchar ),
ADD_TEST( short ),
ADD_TEST( ushort ),
ADD_TEST( int ),
ADD_TEST( uint ),
ADD_TEST( long ),
ADD_TEST( ulong ),
ADD_TEST( float ),
ADD_TEST( double ),
};
const char *basefn_names[] = {
"char",
"uchar",
"short",
"ushort",
"int",
"uint",
"long",
"ulong",
"float",
"double",
};
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)
{
log_info( "\nChecking operations on cl_types.\nNumbers, where presented, should walk upward from 0, with step of 1:\n" );
return parseAndCallCommandLineTests( argc, argv, NULL, num_fns, basefn_list, basefn_names, true, 0, 0 );
return parseAndCallCommandLineTests( argc, argv, NULL, test_num, test_list, true, 0, 0 );
}

View File

@@ -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 );
}
}

View File

@@ -61,25 +61,15 @@ int test_3D(cl_device_id deviceID, cl_context context, cl_command_queue queue, i
return test_image_set(device, k3D);
}
basefn basefn_list[] = {
test_1D,
test_2D,
test_1Darray,
test_2Darray,
test_3D,
test_definition test_list[] = {
ADD_TEST( 1D ),
ADD_TEST( 2D ),
ADD_TEST( 1Darray ),
ADD_TEST( 2Darray ),
ADD_TEST( 3D ),
};
const char *basefn_names[] = {
"1D",
"2D",
"1Darray",
"2Darray",
"3D",
};
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" );

View File

@@ -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 );
}
}

View File

@@ -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 );
}
}

View File

@@ -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[])
{
@@ -231,7 +221,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);
@@ -270,8 +260,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 );
}
}

View File

@@ -247,26 +247,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[])
{
@@ -531,7 +520,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);
@@ -613,8 +602,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 );
}
}

View File

@@ -74,25 +74,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[])
{
@@ -253,7 +243,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);
@@ -310,8 +300,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 );
}
}

View File

@@ -24,253 +24,128 @@
#include <unistd.h>
#endif
basefn basefn_list[] = {
test_integer_clz,
test_integer_ctz,
test_integer_hadd,
test_integer_rhadd,
test_integer_mul_hi,
test_integer_rotate,
test_integer_clamp,
test_integer_mad_sat,
test_integer_mad_hi,
test_integer_min,
test_integer_max,
test_integer_upsample,
test_definition test_list[] = {
ADD_TEST( integer_clz ),
ADD_TEST( integer_ctz ),
ADD_TEST( integer_hadd ),
ADD_TEST( integer_rhadd ),
ADD_TEST( integer_mul_hi ),
ADD_TEST( integer_rotate ),
ADD_TEST( integer_clamp ),
ADD_TEST( integer_mad_sat ),
ADD_TEST( integer_mad_hi ),
ADD_TEST( integer_min ),
ADD_TEST( integer_max ),
ADD_TEST( integer_upsample ),
test_abs,
test_absdiff,
test_add_sat,
test_sub_sat,
ADD_TEST( integer_abs ),
ADD_TEST( integer_abs_diff ),
ADD_TEST( integer_add_sat ),
ADD_TEST( integer_sub_sat ),
test_integer_addAssign,
test_integer_subtractAssign,
test_integer_multiplyAssign,
test_integer_divideAssign,
test_integer_moduloAssign,
test_integer_andAssign,
test_integer_orAssign,
test_integer_exclusiveOrAssign,
ADD_TEST( integer_addAssign ),
ADD_TEST( integer_subtractAssign ),
ADD_TEST( integer_multiplyAssign ),
ADD_TEST( integer_divideAssign ),
ADD_TEST( integer_moduloAssign ),
ADD_TEST( integer_andAssign ),
ADD_TEST( integer_orAssign ),
ADD_TEST( integer_exclusiveOrAssign ),
test_unary_ops_increment,
test_unary_ops_decrement,
test_unary_ops_full,
ADD_TEST( unary_ops_increment ),
ADD_TEST( unary_ops_decrement ),
ADD_TEST( unary_ops_full ),
test_intmul24,
test_intmad24,
ADD_TEST( integer_mul24 ),
ADD_TEST( integer_mad24 ),
test_long_math,
test_long_logic,
test_long_shift,
test_long_compare,
ADD_TEST( long_math ),
ADD_TEST( long_logic ),
ADD_TEST( long_shift ),
ADD_TEST( long_compare ),
test_ulong_math,
test_ulong_logic,
test_ulong_shift,
test_ulong_compare,
ADD_TEST( ulong_math ),
ADD_TEST( ulong_logic ),
ADD_TEST( ulong_shift ),
ADD_TEST( ulong_compare ),
test_int_math,
test_int_logic,
test_int_shift,
test_int_compare,
ADD_TEST( int_math ),
ADD_TEST( int_logic ),
ADD_TEST( int_shift ),
ADD_TEST( int_compare ),
test_uint_math,
test_uint_logic,
test_uint_shift,
test_uint_compare,
ADD_TEST( uint_math ),
ADD_TEST( uint_logic ),
ADD_TEST( uint_shift ),
ADD_TEST( uint_compare ),
test_short_math,
test_short_logic,
test_short_shift,
test_short_compare,
ADD_TEST( short_math ),
ADD_TEST( short_logic ),
ADD_TEST( short_shift ),
ADD_TEST( short_compare ),
test_ushort_math,
test_ushort_logic,
test_ushort_shift,
test_ushort_compare,
ADD_TEST( ushort_math ),
ADD_TEST( ushort_logic ),
ADD_TEST( ushort_shift ),
ADD_TEST( ushort_compare ),
test_char_math,
test_char_logic,
test_char_shift,
test_char_compare,
ADD_TEST( char_math ),
ADD_TEST( char_logic ),
ADD_TEST( char_shift ),
ADD_TEST( char_compare ),
test_uchar_math,
test_uchar_logic,
test_uchar_shift,
test_uchar_compare,
test_popcount,
ADD_TEST( uchar_math ),
ADD_TEST( uchar_logic ),
ADD_TEST( uchar_shift ),
ADD_TEST( uchar_compare ),
ADD_TEST( popcount ),
// Quick
test_quick_long_math,
test_quick_long_logic,
test_quick_long_shift,
test_quick_long_compare,
ADD_TEST( quick_long_math ),
ADD_TEST( quick_long_logic ),
ADD_TEST( quick_long_shift ),
ADD_TEST( quick_long_compare ),
test_quick_ulong_math,
test_quick_ulong_logic,
test_quick_ulong_shift,
test_quick_ulong_compare,
ADD_TEST( quick_ulong_math ),
ADD_TEST( quick_ulong_logic ),
ADD_TEST( quick_ulong_shift ),
ADD_TEST( quick_ulong_compare ),
test_quick_int_math,
test_quick_int_logic,
test_quick_int_shift,
test_quick_int_compare,
ADD_TEST( quick_int_math ),
ADD_TEST( quick_int_logic ),
ADD_TEST( quick_int_shift ),
ADD_TEST( quick_int_compare ),
test_quick_uint_math,
test_quick_uint_logic,
test_quick_uint_shift,
test_quick_uint_compare,
ADD_TEST( quick_uint_math ),
ADD_TEST( quick_uint_logic ),
ADD_TEST( quick_uint_shift ),
ADD_TEST( quick_uint_compare ),
test_quick_short_math,
test_quick_short_logic,
test_quick_short_shift,
test_quick_short_compare,
ADD_TEST( quick_short_math ),
ADD_TEST( quick_short_logic ),
ADD_TEST( quick_short_shift ),
ADD_TEST( quick_short_compare ),
test_quick_ushort_math,
test_quick_ushort_logic,
test_quick_ushort_shift,
test_quick_ushort_compare,
ADD_TEST( quick_ushort_math ),
ADD_TEST( quick_ushort_logic ),
ADD_TEST( quick_ushort_shift ),
ADD_TEST( quick_ushort_compare ),
test_quick_char_math,
test_quick_char_logic,
test_quick_char_shift,
test_quick_char_compare,
ADD_TEST( quick_char_math ),
ADD_TEST( quick_char_logic ),
ADD_TEST( quick_char_shift ),
ADD_TEST( quick_char_compare ),
test_quick_uchar_math,
test_quick_uchar_logic,
test_quick_uchar_shift,
test_quick_uchar_compare,
ADD_TEST( quick_uchar_math ),
ADD_TEST( quick_uchar_logic ),
ADD_TEST( quick_uchar_shift ),
ADD_TEST( quick_uchar_compare ),
test_vector_scalar_ops,
ADD_TEST( vector_scalar ),
};
const char *basefn_names[] = {
"integer_clz",
"integer_ctz",
"integer_hadd",
"integer_rhadd",
"integer_mul_hi",
"integer_rotate",
"integer_clamp",
"integer_mad_sat",
"integer_mad_hi",
"integer_min",
"integer_max",
"integer_upsample",
"integer_abs",
"integer_abs_diff",
"integer_add_sat",
"integer_sub_sat",
"integer_addAssign",
"integer_subtractAssign",
"integer_multiplyAssign",
"integer_divideAssign",
"integer_moduloAssign",
"integer_andAssign",
"integer_orAssign",
"integer_exclusiveOrAssign",
"unary_ops_increment",
"unary_ops_decrement",
"unary_ops_full",
"integer_mul24",
"integer_mad24",
"long_math",
"long_logic",
"long_shift",
"long_compare",
"ulong_math",
"ulong_logic",
"ulong_shift",
"ulong_compare",
"int_math",
"int_logic",
"int_shift",
"int_compare",
"uint_math",
"uint_logic",
"uint_shift",
"uint_compare",
"short_math",
"short_logic",
"short_shift",
"short_compare",
"ushort_math",
"ushort_logic",
"ushort_shift",
"ushort_compare",
"char_math",
"char_logic",
"char_shift",
"char_compare",
"uchar_math",
"uchar_logic",
"uchar_shift",
"uchar_compare",
"popcount",
// Quick
"quick_long_math",
"quick_long_logic",
"quick_long_shift",
"quick_long_compare",
"quick_ulong_math",
"quick_ulong_logic",
"quick_ulong_shift",
"quick_ulong_compare",
"quick_int_math",
"quick_int_logic",
"quick_int_shift",
"quick_int_compare",
"quick_uint_math",
"quick_uint_logic",
"quick_uint_shift",
"quick_uint_compare",
"quick_short_math",
"quick_short_logic",
"quick_short_shift",
"quick_short_compare",
"quick_ushort_math",
"quick_ushort_logic",
"quick_ushort_shift",
"quick_ushort_compare",
"quick_char_math",
"quick_char_logic",
"quick_char_shift",
"quick_char_compare",
"quick_uchar_math",
"quick_uchar_logic",
"quick_uchar_shift",
"quick_uchar_compare",
"vector_scalar",
};
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 );
void fill_test_values( cl_long *outBufferA, cl_long *outBufferB, size_t numElements, MTdata d )
{
@@ -335,13 +210,8 @@ void fill_test_values( cl_long *outBufferA, cl_long *outBufferB, size_t numEleme
}
}
int main(int argc, const char *argv[])
{
return runTestHarness( argc, argv, num_fns, basefn_list, basefn_names, false /* image support required */, false /* force no context creation */, 0 );
return runTestHarness( argc, argv, test_num, test_list, false, false, 0 );
}

View File

@@ -53,13 +53,13 @@ extern int test_integer_andAssign(cl_device_id deviceID, cl_context context, cl_
extern int test_integer_orAssign(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_integer_exclusiveOrAssign(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_abs(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_absdiff(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_add_sat(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_sub_sat(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_integer_abs(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_integer_abs_diff(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_integer_add_sat(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_integer_sub_sat(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_intmul24(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_intmad24(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_integer_mul24(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_integer_mad24(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_long_math(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
@@ -139,5 +139,5 @@ extern int test_unary_ops_full(cl_device_id deviceID, cl_context context, cl_com
extern int test_unary_ops_increment(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_unary_ops_decrement(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_vector_scalar_ops(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_vector_scalar(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);

View File

@@ -174,7 +174,7 @@ static const char * dest_stores[] = {
" vstore3(tmp, tid, dst);\n"
};
int test_abs(cl_device_id device, cl_context context, cl_command_queue queue, int n_elems)
int test_integer_abs(cl_device_id device, cl_context context, cl_command_queue queue, int n_elems)
{
cl_int *input_ptr, *output_ptr, *p;
int err;

View File

@@ -183,7 +183,7 @@ static void printSrc(const char *src[], int nSrcStrings) {
}
}
int test_absdiff(cl_device_id device, cl_context context, cl_command_queue queue, int n_elems)
int test_integer_abs_diff(cl_device_id device, cl_context context, cl_command_queue queue, int n_elems)
{
cl_int *input_ptr[2], *output_ptr, *p;
int err;

View File

@@ -181,7 +181,7 @@ static const int vector_sizes[] = {1, 2, 3, 4, 8, 16};
static const char *vector_size_names[] = { "", "2", "3", "4", "8", "16" };
static const size_t kSizes[8] = { 1, 1, 2, 2, 4, 4, 8, 8 };
int test_add_sat(cl_device_id device, cl_context context, cl_command_queue queue, int n_elems)
int test_integer_add_sat(cl_device_id device, cl_context context, cl_command_queue queue, int n_elems)
{
cl_int *input_ptr[2], *output_ptr, *p;
int err;

View File

@@ -1331,7 +1331,7 @@ int run_vector_scalar_tests( cl_device_id deviceID, cl_context context, cl_comma
return errors;
}
int test_vector_scalar_ops(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
int test_vector_scalar(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
int errors = 0;
int numTypes = sizeof( types ) / sizeof( types[ 0 ] );

View File

@@ -183,8 +183,7 @@ static inline int random_int32( MTdata d )
}
int
test_intmad24(cl_device_id device, cl_context context, cl_command_queue queue, int n_elems)
int test_integer_mad24(cl_device_id device, cl_context context, cl_command_queue queue, int n_elems)
{
cl_mem streams[4];
cl_int *input_ptr[3], *output_ptr, *p;

View File

@@ -171,8 +171,7 @@ static inline int random_int24( MTdata d )
static const char *test_str_names[] = { "int", "int2", "int3", "int4", "int8", "int16", "uint", "uint2", "uint3", "uint4", "uint8", "uint16" };
int
test_intmul24(cl_device_id device, cl_context context, cl_command_queue queue, int n_elems)
int test_integer_mul24(cl_device_id device, cl_context context, cl_command_queue queue, int n_elems)
{
cl_mem streams[3];
cl_int *input_ptr[2], *output_ptr, *p;

View File

@@ -181,7 +181,7 @@ static const char *vector_size_names[] = { "", "2", "3", "4", "8", "16" };
static const size_t kSizes[8] = { 1, 1, 2, 2, 4, 4, 8, 8 };
int test_sub_sat(cl_device_id device, cl_context context, cl_command_queue queue, int n_elems)
int test_integer_sub_sat(cl_device_id device, cl_context context, cl_command_queue queue, int n_elems)
{
int *input_ptr[2], *output_ptr, *p;
int err;

View File

@@ -703,215 +703,110 @@ int test_not( cl_device_id deviceID, cl_context context, cl_command_queue queue,
return doTest( "not" );
}
basefn basefn_list[] = {
test_acos,
test_acosh,
test_acospi,
test_asin,
test_asinh,
test_asinpi,
test_atan,
test_atanh,
test_atanpi,
test_atan2,
test_atan2pi,
test_cbrt,
test_ceil,
test_copysign,
test_cos,
test_cosh,
test_cospi,
test_exp,
test_exp2,
test_exp10,
test_expm1,
test_fabs,
test_fdim,
test_floor,
test_fma,
test_fmax,
test_fmin,
test_fmod,
test_fract,
test_frexp,
test_hypot,
test_ilogb,
test_isequal,
test_isfinite,
test_isgreater,
test_isgreaterequal,
test_isinf,
test_isless,
test_islessequal,
test_islessgreater,
test_isnan,
test_isnormal,
test_isnotequal,
test_isordered,
test_isunordered,
test_ldexp,
test_lgamma,
test_lgamma_r,
test_log,
test_log2,
test_log10,
test_log1p,
test_logb,
test_mad,
test_maxmag,
test_minmag,
test_modf,
test_nan,
test_nextafter,
test_pow,
test_pown,
test_powr,
test_remainder,
test_remquo,
test_rint,
test_rootn,
test_round,
test_rsqrt,
test_signbit,
test_sin,
test_sincos,
test_sinh,
test_sinpi,
test_sqrt,
test_sqrt_cr,
test_tan,
test_tanh,
test_tanpi,
test_trunc,
test_half_cos,
test_half_divide,
test_half_exp,
test_half_exp2,
test_half_exp10,
test_half_log,
test_half_log2,
test_half_log10,
test_half_powr,
test_half_recip,
test_half_rsqrt,
test_half_sin,
test_half_sqrt,
test_half_tan,
test_add,
test_subtract,
test_divide,
test_divide_cr,
test_multiply,
test_assignment,
test_not,
test_definition test_list[] = {
ADD_TEST( acos ),
ADD_TEST( acosh ),
ADD_TEST( acospi ),
ADD_TEST( asin ),
ADD_TEST( asinh ),
ADD_TEST( asinpi ),
ADD_TEST( atan ),
ADD_TEST( atanh ),
ADD_TEST( atanpi ),
ADD_TEST( atan2 ),
ADD_TEST( atan2pi ),
ADD_TEST( cbrt ),
ADD_TEST( ceil ),
ADD_TEST( copysign ),
ADD_TEST( cos ),
ADD_TEST( cosh ),
ADD_TEST( cospi ),
ADD_TEST( exp ),
ADD_TEST( exp2 ),
ADD_TEST( exp10 ),
ADD_TEST( expm1 ),
ADD_TEST( fabs ),
ADD_TEST( fdim ),
ADD_TEST( floor ),
ADD_TEST( fma ),
ADD_TEST( fmax ),
ADD_TEST( fmin ),
ADD_TEST( fmod ),
ADD_TEST( fract ),
ADD_TEST( frexp ),
ADD_TEST( hypot ),
ADD_TEST( ilogb ),
ADD_TEST( isequal ),
ADD_TEST( isfinite ),
ADD_TEST( isgreater ),
ADD_TEST( isgreaterequal ),
ADD_TEST( isinf ),
ADD_TEST( isless ),
ADD_TEST( islessequal ),
ADD_TEST( islessgreater ),
ADD_TEST( isnan ),
ADD_TEST( isnormal ),
ADD_TEST( isnotequal ),
ADD_TEST( isordered ),
ADD_TEST( isunordered ),
ADD_TEST( ldexp ),
ADD_TEST( lgamma ),
ADD_TEST( lgamma_r ),
ADD_TEST( log ),
ADD_TEST( log2 ),
ADD_TEST( log10 ),
ADD_TEST( log1p ),
ADD_TEST( logb ),
ADD_TEST( mad ),
ADD_TEST( maxmag ),
ADD_TEST( minmag ),
ADD_TEST( modf ),
ADD_TEST( nan ),
ADD_TEST( nextafter ),
ADD_TEST( pow ),
ADD_TEST( pown ),
ADD_TEST( powr ),
ADD_TEST( remainder ),
ADD_TEST( remquo ),
ADD_TEST( rint ),
ADD_TEST( rootn ),
ADD_TEST( round ),
ADD_TEST( rsqrt ),
ADD_TEST( signbit ),
ADD_TEST( sin ),
ADD_TEST( sincos ),
ADD_TEST( sinh ),
ADD_TEST( sinpi ),
ADD_TEST( sqrt ),
ADD_TEST( sqrt_cr ),
ADD_TEST( tan ),
ADD_TEST( tanh ),
ADD_TEST( tanpi ),
ADD_TEST( trunc ),
ADD_TEST( half_cos ),
ADD_TEST( half_divide ),
ADD_TEST( half_exp ),
ADD_TEST( half_exp2 ),
ADD_TEST( half_exp10 ),
ADD_TEST( half_log ),
ADD_TEST( half_log2 ),
ADD_TEST( half_log10 ),
ADD_TEST( half_powr ),
ADD_TEST( half_recip ),
ADD_TEST( half_rsqrt ),
ADD_TEST( half_sin ),
ADD_TEST( half_sqrt ),
ADD_TEST( half_tan ),
ADD_TEST( add ),
ADD_TEST( subtract ),
ADD_TEST( divide ),
ADD_TEST( divide_cr ),
ADD_TEST( multiply ),
ADD_TEST( assignment ),
ADD_TEST( not ),
};
const char *basefn_names[] = {
"acos",
"acosh",
"acospi",
"asin",
"asinh",
"asinpi",
"atan",
"atanh",
"atanpi",
"atan2",
"atan2pi",
"cbrt",
"ceil",
"copysign",
"cos",
"cosh",
"cospi",
"exp",
"exp2",
"exp10",
"expm1",
"fabs",
"fdim",
"floor",
"fma",
"fmax",
"fmin",
"fmod",
"fract",
"frexp",
"hypot",
"ilogb",
"isequal",
"isfinite",
"isgreater",
"isgreaterequal",
"isinf",
"isless",
"islessequal",
"islessgreater",
"isnan",
"isnormal",
"isnotequal",
"isordered",
"isunordered",
"ldexp",
"lgamma",
"lgamma_r",
"log",
"log2",
"log10",
"log1p",
"logb",
"mad",
"maxmag",
"minmag",
"modf",
"nan",
"nextafter",
"pow",
"pown",
"powr",
"remainder",
"remquo",
"rint",
"rootn",
"round",
"rsqrt",
"signbit",
"sin",
"sincos",
"sinh",
"sinpi",
"sqrt",
"sqrt_cr",
"tan",
"tanh",
"tanpi",
"trunc",
"half_cos",
"half_divide",
"half_exp",
"half_exp2",
"half_exp10",
"half_log",
"half_log2",
"half_log10",
"half_powr",
"half_recip",
"half_rsqrt",
"half_sin",
"half_sqrt",
"half_tan",
"add",
"subtract",
"divide",
"divide_cr",
"multiply",
"assignment",
"not",
};
ct_assert((sizeof(basefn_names) / sizeof(basefn_names[0])) == (sizeof(basefn_list) / sizeof(basefn_list[0])));
const int num_fns = sizeof(basefn_names) / sizeof(char *);
const int test_num = ARRAY_SIZE( test_list );
#pragma mark -
@@ -978,7 +873,7 @@ int main (int argc, const char * argv[])
FPU_mode_type oldMode;
DisableFTZ( &oldMode );
int ret = parseAndCallCommandLineTests( gTestNameCount, gTestNames, NULL, num_fns, basefn_list, basefn_names, true, 0, 0 );
int ret = parseAndCallCommandLineTests( gTestNameCount, gTestNames, NULL, test_num, test_list, true, 0, 0 );
RestoreFPState( &oldMode );

View File

@@ -29,40 +29,26 @@
#include <unistd.h>
#endif
basefn clfn_list[] = {test_mem_host_read_only_buffer,
test_mem_host_read_only_subbuffer,
test_mem_host_write_only_buffer,
test_mem_host_write_only_subbuffer,
test_mem_host_no_access_buffer,
test_mem_host_no_access_subbuffer,
test_mem_host_read_only_image,
test_mem_host_write_only_image,
test_mem_host_no_access_image};
const char *clfn_names[] = {"test_mem_host_read_only_buffer",
"test_mem_host_read_only_subbuffer",
"test_mem_host_write_only_buffer",
"test_mem_host_write_only_subbuffer",
"test_mem_host_no_access_buffer",
"test_mem_host_no_access_subbuffer",
"test_mem_host_read_only_image",
"test_mem_host_write_only_image",
"test_mem_host_no_access_image",
test_definition test_list[] = {
ADD_TEST( mem_host_read_only_buffer ),
ADD_TEST( mem_host_read_only_subbuffer ),
ADD_TEST( mem_host_write_only_buffer ),
ADD_TEST( mem_host_write_only_subbuffer ),
ADD_TEST( mem_host_no_access_buffer ),
ADD_TEST( mem_host_no_access_subbuffer ),
ADD_TEST( mem_host_read_only_image ),
ADD_TEST( mem_host_write_only_image ),
ADD_TEST( mem_host_no_access_image ),
};
ct_assert((sizeof(clfn_names) / sizeof(clfn_names[0])) == (sizeof(clfn_list) / sizeof(clfn_list[0])));
int num_fns = sizeof(clfn_names) / sizeof(char *);
const int test_num = ARRAY_SIZE( test_list );
cl_device_type gDeviceType = CL_DEVICE_TYPE_DEFAULT;
bool gTestRounding = true;
int main(int argc, const char *argv[])
{
int error = 0;
test_start();// in fact no code
log_info("1st part, non gl-sharing objects...\n");
error = runTestHarness(argc, argv, num_fns, clfn_list, clfn_names, false, false, 0);
log_info("1st part, non gl-sharing objects...\n");
return error;
return runTestHarness( argc, argv, test_num, test_list, false, false, 0 );
}

View File

@@ -25,38 +25,22 @@
#include <unistd.h>
#endif
basefn basefn_list[] = {
test_multiple_contexts_same_device,
test_two_contexts_same_device,
test_three_contexts_same_device,
test_four_contexts_same_device,
test_definition test_list[] = {
ADD_TEST( context_multiple_contexts_same_device ),
ADD_TEST( context_two_contexts_same_device ),
ADD_TEST( context_three_contexts_same_device ),
ADD_TEST( context_four_contexts_same_device ),
test_two_devices,
test_max_devices,
ADD_TEST( two_devices ),
ADD_TEST( max_devices ),
test_hundred_queues
ADD_TEST( hundred_queues ),
};
const char *basefn_names[] = {
"context_multiple_contexts_same_device",
"context_two_contexts_same_device",
"context_three_contexts_same_device",
"context_four_contexts_same_device",
"two_devices",
"max_devices",
"hundred_queues",
};
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[])
{
return runTestHarness( argc, argv, num_fns, basefn_list, basefn_names, false, true, 0 );
return runTestHarness( argc, argv, test_num, test_list, false, true, 0 );
}

View File

@@ -18,10 +18,10 @@
#include "../../test_common/harness/typeWrappers.h"
#include "../../test_common/harness/mt19937.h"
extern int test_multiple_contexts_same_device(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_two_contexts_same_device(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_three_contexts_same_device(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_four_contexts_same_device(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_context_multiple_contexts_same_device(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_context_two_contexts_same_device(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_context_three_contexts_same_device(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_context_four_contexts_same_device(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_two_devices(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_max_devices(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);

View File

@@ -398,7 +398,7 @@ cl_int UseTestItem( const TestItem *item, cl_int *err )
int test_multiple_contexts_same_device(cl_device_id deviceID, size_t maxCount, size_t minCount )
int test_context_multiple_contexts_same_device(cl_device_id deviceID, size_t maxCount, size_t minCount )
{
size_t i, j;
cl_int err = CL_SUCCESS;
@@ -507,23 +507,23 @@ exit:
// sane limit, currently 200), attempting to use each along the way. We keep track of how many we could make before
// a failure occurred. We then free everything and attempt to go do it again a few times. If you are able to make
// that many contexts 5 times over, then you pass.
int test_multiple_contexts_same_device(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
int test_context_multiple_contexts_same_device(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
return test_multiple_contexts_same_device( deviceID, 200, 1 );
return test_context_multiple_contexts_same_device( deviceID, 200, 1 );
}
int test_two_contexts_same_device(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
int test_context_two_contexts_same_device(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
return test_multiple_contexts_same_device( deviceID, 2, 2 );
return test_context_multiple_contexts_same_device( deviceID, 2, 2 );
}
int test_three_contexts_same_device(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
int test_context_three_contexts_same_device(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
return test_multiple_contexts_same_device( deviceID, 3, 3 );
return test_context_multiple_contexts_same_device( deviceID, 3, 3 );
}
int test_four_contexts_same_device(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
int test_context_four_contexts_same_device(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
return test_multiple_contexts_same_device( deviceID, 4, 4 );
return test_context_multiple_contexts_same_device( deviceID, 4, 4 );
}

View File

@@ -18,45 +18,25 @@
#include "../../test_common/harness/testHarness.h"
#include "TestNonUniformWorkGroup.h"
basefn basefn_list[] = {
test_non_uniform_1d_basic,
test_non_uniform_1d_atomics,
test_non_uniform_1d_barriers,
test_definition test_list[] = {
ADD_TEST( non_uniform_1d_basic ),
ADD_TEST( non_uniform_1d_atomics ),
ADD_TEST( non_uniform_1d_barriers ),
test_non_uniform_2d_basic,
test_non_uniform_2d_atomics,
test_non_uniform_2d_barriers,
ADD_TEST( non_uniform_2d_basic ),
ADD_TEST( non_uniform_2d_atomics ),
ADD_TEST( non_uniform_2d_barriers ),
test_non_uniform_3d_basic,
test_non_uniform_3d_atomics,
test_non_uniform_3d_barriers,
ADD_TEST( non_uniform_3d_basic ),
ADD_TEST( non_uniform_3d_atomics ),
ADD_TEST( non_uniform_3d_barriers ),
test_non_uniform_other_basic,
test_non_uniform_other_atomics,
test_non_uniform_other_barriers
ADD_TEST( non_uniform_other_basic ),
ADD_TEST( non_uniform_other_atomics ),
ADD_TEST( non_uniform_other_barriers ),
};
const char *basefn_names[] = {
"non_uniform_1d_basic",
"non_uniform_1d_atomics",
"non_uniform_1d_barriers",
"non_uniform_2d_basic",
"non_uniform_2d_atomics",
"non_uniform_2d_barriers",
"non_uniform_3d_basic",
"non_uniform_3d_atomics",
"non_uniform_3d_barriers",
"non_uniform_other_basic",
"non_uniform_other_atomics",
"non_uniform_other_barriers",
};
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[])
{
@@ -64,10 +44,6 @@ int main(int argc, const char *argv[])
ArgsVector programArgs;
programArgs.assign(argv, argv+argc);
int numFns = num_fns;
basefn *baseFnList = basefn_list;
const char **baseFnNames = basefn_names;
for (ArgsVector::iterator it = programArgs.begin(); it!=programArgs.end();) {
if(*it == std::string("-strict")) {
@@ -80,9 +56,6 @@ int main(int argc, const char *argv[])
PrimeNumbers::generatePrimeNumbers(100000);
return runTestHarness(static_cast<int>(programArgs.size()), &programArgs.front(), numFns, baseFnList, baseFnNames, false /* image support required */, false /* force no context creation */, 0 );
return runTestHarness(static_cast<int>(programArgs.size()), &programArgs.front(), test_num, test_list, false, false, 0 );
}

View File

@@ -20,128 +20,67 @@
#include "procs.h"
#include "../../test_common/harness/testHarness.h"
basefn pipefn_list[] = {
test_pipe_readwrite_int,
test_pipe_readwrite_uint,
test_pipe_readwrite_long,
test_pipe_readwrite_ulong,
test_pipe_readwrite_short,
test_pipe_readwrite_ushort,
test_pipe_readwrite_float,
test_pipe_readwrite_half,
test_pipe_readwrite_char,
test_pipe_readwrite_uchar,
test_pipe_readwrite_double,
test_pipe_readwrite_struct,
test_pipe_workgroup_readwrite_int,
test_pipe_workgroup_readwrite_uint,
test_pipe_workgroup_readwrite_long,
test_pipe_workgroup_readwrite_ulong,
test_pipe_workgroup_readwrite_short,
test_pipe_workgroup_readwrite_ushort,
test_pipe_workgroup_readwrite_float,
test_pipe_workgroup_readwrite_half,
test_pipe_workgroup_readwrite_char,
test_pipe_workgroup_readwrite_uchar,
test_pipe_workgroup_readwrite_double,
test_pipe_workgroup_readwrite_struct,
test_pipe_subgroup_readwrite_int,
test_pipe_subgroup_readwrite_uint,
test_pipe_subgroup_readwrite_long,
test_pipe_subgroup_readwrite_ulong,
test_pipe_subgroup_readwrite_short,
test_pipe_subgroup_readwrite_ushort,
test_pipe_subgroup_readwrite_float,
test_pipe_subgroup_readwrite_half,
test_pipe_subgroup_readwrite_char,
test_pipe_subgroup_readwrite_uchar,
test_pipe_subgroup_readwrite_double,
test_pipe_subgroup_readwrite_struct,
test_pipe_convenience_readwrite_int,
test_pipe_convenience_readwrite_uint,
test_pipe_convenience_readwrite_long,
test_pipe_convenience_readwrite_ulong,
test_pipe_convenience_readwrite_short,
test_pipe_convenience_readwrite_ushort,
test_pipe_convenience_readwrite_float,
test_pipe_convenience_readwrite_half,
test_pipe_convenience_readwrite_char,
test_pipe_convenience_readwrite_uchar,
test_pipe_convenience_readwrite_double,
test_pipe_convenience_readwrite_struct,
test_pipe_info,
test_pipe_max_args,
test_pipe_max_packet_size,
test_pipe_max_active_reservations,
test_pipe_query_functions,
test_pipe_readwrite_errors,
test_pipe_subgroups_divergence
test_definition test_list[] = {
ADD_TEST( pipe_readwrite_int ),
ADD_TEST( pipe_readwrite_uint ),
ADD_TEST( pipe_readwrite_long ),
ADD_TEST( pipe_readwrite_ulong ),
ADD_TEST( pipe_readwrite_short ),
ADD_TEST( pipe_readwrite_ushort ),
ADD_TEST( pipe_readwrite_float ),
ADD_TEST( pipe_readwrite_half ),
ADD_TEST( pipe_readwrite_char ),
ADD_TEST( pipe_readwrite_uchar ),
ADD_TEST( pipe_readwrite_double ),
ADD_TEST( pipe_readwrite_struct ),
ADD_TEST( pipe_workgroup_readwrite_int ),
ADD_TEST( pipe_workgroup_readwrite_uint ),
ADD_TEST( pipe_workgroup_readwrite_long ),
ADD_TEST( pipe_workgroup_readwrite_ulong ),
ADD_TEST( pipe_workgroup_readwrite_short ),
ADD_TEST( pipe_workgroup_readwrite_ushort ),
ADD_TEST( pipe_workgroup_readwrite_float ),
ADD_TEST( pipe_workgroup_readwrite_half ),
ADD_TEST( pipe_workgroup_readwrite_char ),
ADD_TEST( pipe_workgroup_readwrite_uchar ),
ADD_TEST( pipe_workgroup_readwrite_double ),
ADD_TEST( pipe_workgroup_readwrite_struct ),
ADD_TEST( pipe_subgroup_readwrite_int ),
ADD_TEST( pipe_subgroup_readwrite_uint ),
ADD_TEST( pipe_subgroup_readwrite_long ),
ADD_TEST( pipe_subgroup_readwrite_ulong ),
ADD_TEST( pipe_subgroup_readwrite_short ),
ADD_TEST( pipe_subgroup_readwrite_ushort ),
ADD_TEST( pipe_subgroup_readwrite_float ),
ADD_TEST( pipe_subgroup_readwrite_half ),
ADD_TEST( pipe_subgroup_readwrite_char ),
ADD_TEST( pipe_subgroup_readwrite_uchar ),
ADD_TEST( pipe_subgroup_readwrite_double ),
ADD_TEST( pipe_subgroup_readwrite_struct ),
ADD_TEST( pipe_convenience_readwrite_int ),
ADD_TEST( pipe_convenience_readwrite_uint ),
ADD_TEST( pipe_convenience_readwrite_long ),
ADD_TEST( pipe_convenience_readwrite_ulong ),
ADD_TEST( pipe_convenience_readwrite_short ),
ADD_TEST( pipe_convenience_readwrite_ushort ),
ADD_TEST( pipe_convenience_readwrite_float ),
ADD_TEST( pipe_convenience_readwrite_half ),
ADD_TEST( pipe_convenience_readwrite_char ),
ADD_TEST( pipe_convenience_readwrite_uchar ),
ADD_TEST( pipe_convenience_readwrite_double ),
ADD_TEST( pipe_convenience_readwrite_struct ),
ADD_TEST( pipe_info ),
ADD_TEST( pipe_max_args ),
ADD_TEST( pipe_max_packet_size ),
ADD_TEST( pipe_max_active_reservations ),
ADD_TEST( pipe_query_functions ),
ADD_TEST( pipe_readwrite_errors ),
ADD_TEST( pipe_subgroups_divergence ),
};
const char *pipefn_names[] = {
"pipe_readwrite_int",
"pipe_readwrite_uint",
"pipe_readwrite_long",
"pipe_readwrite_ulong",
"pipe_readwrite_short",
"pipe_readwrite_ushort",
"pipe_readwrite_float",
"pipe_readwrite_half",
"pipe_readwrite_char",
"pipe_readwrite_uchar",
"pipe_readwrite_double",
"pipe_readwrite_struct",
"pipe_workgroup_readwrite_int",
"pipe_workgroup_readwrite_uint",
"pipe_workgroup_readwrite_long",
"pipe_workgroup_readwrite_ulong",
"pipe_workgroup_readwrite_short",
"pipe_workgroup_readwrite_ushort",
"pipe_workgroup_readwrite_float",
"pipe_workgroup_readwrite_half",
"pipe_workgroup_readwrite_char",
"pipe_workgroup_readwrite_uchar",
"pipe_workgroup_readwrite_double",
"pipe_workgroup_readwrite_struct",
"pipe_subgroup_readwrite_int",
"pipe_subgroup_readwrite_uint",
"pipe_subgroup_readwrite_long",
"pipe_subgroup_readwrite_ulong",
"pipe_subgroup_readwrite_short",
"pipe_subgroup_readwrite_ushort",
"pipe_subgroup_readwrite_float",
"pipe_subgroup_readwrite_half",
"pipe_subgroup_readwrite_char",
"pipe_subgroup_readwrite_uchar",
"pipe_subgroup_readwrite_double",
"pipe_subgroup_readwrite_struct",
"pipe_convenience_readwrite_int",
"pipe_convenience_readwrite_uint",
"pipe_convenience_readwrite_long",
"pipe_convenience_readwrite_ulong",
"pipe_convenience_readwrite_short",
"pipe_convenience_readwrite_ushort",
"pipe_convenience_readwrite_float",
"pipe_convenience_readwrite_half",
"pipe_convenience_readwrite_char",
"pipe_convenience_readwrite_uchar",
"pipe_convenience_readwrite_double",
"pipe_convenience_readwrite_struct",
"pipe_info",
"pipe_max_args",
"pipe_max_packet_size",
"pipe_max_active_reservations",
"pipe_query_functions",
"pipe_readwrite_errors",
"pipe_subgroups_divergence",
};
ct_assert((sizeof(pipefn_names) / sizeof(pipefn_names[0])) == (sizeof(pipefn_list) / sizeof(pipefn_list[0])));
int num_pipefns = sizeof(pipefn_names) / sizeof(char *);
const int test_num = ARRAY_SIZE( test_list );
int main( int argc, const char *argv[] )
{
return runTestHarness( argc, argv, num_pipefns, pipefn_list, pipefn_names,
false, false, 0 );
return runTestHarness( argc, argv, test_num, test_list, false, false, 0 );
}

View File

@@ -902,145 +902,75 @@ int test_address_space_4(cl_device_id deviceID, cl_context context, cl_command_q
return doTest(gQueue, gContext, TYPE_ADDRESS_SPACE, 4, gDevice);
}
basefn basefn_list[] = {
test_int_0,
test_int_1,
test_int_2,
test_int_3,
test_int_4,
test_int_5,
test_int_6,
test_int_7,
test_int_8,
test_definition test_list[] = {
ADD_TEST( int_0 ),
ADD_TEST( int_1 ),
ADD_TEST( int_2 ),
ADD_TEST( int_3 ),
ADD_TEST( int_4 ),
ADD_TEST( int_5 ),
ADD_TEST( int_6 ),
ADD_TEST( int_7 ),
ADD_TEST( int_8 ),
test_float_0,
test_float_1,
test_float_2,
test_float_3,
test_float_4,
test_float_5,
test_float_6,
test_float_7,
test_float_8,
test_float_9,
test_float_10,
test_float_11,
test_float_12,
test_float_13,
test_float_14,
test_float_15,
test_float_16,
test_float_17,
test_float_18,
test_float_19,
test_float_20,
ADD_TEST( float_0 ),
ADD_TEST( float_1 ),
ADD_TEST( float_2 ),
ADD_TEST( float_3 ),
ADD_TEST( float_4 ),
ADD_TEST( float_5 ),
ADD_TEST( float_6 ),
ADD_TEST( float_7 ),
ADD_TEST( float_8 ),
ADD_TEST( float_9 ),
ADD_TEST( float_10 ),
ADD_TEST( float_11 ),
ADD_TEST( float_12 ),
ADD_TEST( float_13 ),
ADD_TEST( float_14 ),
ADD_TEST( float_15 ),
ADD_TEST( float_16 ),
ADD_TEST( float_17 ),
ADD_TEST( float_18 ),
ADD_TEST( float_19 ),
ADD_TEST( float_20 ),
test_octal_0,
test_octal_1,
test_octal_2,
test_octal_3,
ADD_TEST( octal_0 ),
ADD_TEST( octal_1 ),
ADD_TEST( octal_2 ),
ADD_TEST( octal_3 ),
test_unsigned_0,
test_unsigned_1,
ADD_TEST( unsigned_0 ),
ADD_TEST( unsigned_1 ),
test_hexadecimal_0,
test_hexadecimal_1,
test_hexadecimal_2,
test_hexadecimal_3,
test_hexadecimal_4,
ADD_TEST( hexadecimal_0 ),
ADD_TEST( hexadecimal_1 ),
ADD_TEST( hexadecimal_2 ),
ADD_TEST( hexadecimal_3 ),
ADD_TEST( hexadecimal_4 ),
test_char_0,
test_char_1,
test_char_2,
ADD_TEST( char_0 ),
ADD_TEST( char_1 ),
ADD_TEST( char_2 ),
test_string_0,
test_string_1,
test_string_2,
ADD_TEST( string_0 ),
ADD_TEST( string_1 ),
ADD_TEST( string_2 ),
test_vector_0,
test_vector_1,
test_vector_2,
test_vector_3,
test_vector_4,
ADD_TEST( vector_0 ),
ADD_TEST( vector_1 ),
ADD_TEST( vector_2 ),
ADD_TEST( vector_3 ),
ADD_TEST( vector_4 ),
test_address_space_0,
test_address_space_1,
test_address_space_2,
test_address_space_3,
test_address_space_4,
ADD_TEST( address_space_0 ),
ADD_TEST( address_space_1 ),
ADD_TEST( address_space_2 ),
ADD_TEST( address_space_3 ),
ADD_TEST( address_space_4 ),
};
const char *basefn_names[] = {
"int_0",
"int_1",
"int_2",
"int_3",
"int_4",
"int_5",
"int_6",
"int_7",
"int_8",
"float_0",
"float_1",
"float_2",
"float_3",
"float_4",
"float_5",
"float_6",
"float_7",
"float_8",
"float_9",
"float_10",
"float_11",
"float_12",
"float_13",
"float_14",
"float_15",
"float_16",
"float_17",
"float_18",
"float_19",
"float_20",
"octal_0",
"octal_1",
"octal_2",
"octal_3",
"unsigned_0",
"unsigned_1",
"hexadecimal_0",
"hexadecimal_1",
"hexadecimal_2",
"hexadecimal_3",
"hexadecimal_4",
"char_0",
"char_1",
"char_2",
"string_0",
"string_1",
"string_2",
"vector_0",
"vector_1",
"vector_2",
"vector_3",
"vector_4",
"address_space_0",
"address_space_1",
"address_space_2",
"address_space_3",
"address_space_4",
};
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 );
//-----------------------------------------
// main
@@ -1182,7 +1112,7 @@ int main(int argc, char* argv[]) {
releaseOutputStream(gFd);
err = parseAndCallCommandLineTests( argCount, argList, NULL, num_fns, basefn_list, basefn_names, true, 0, 0 );
err = parseAndCallCommandLineTests( argCount, argList, NULL, test_num, test_list, true, 0, 0 );
if(gQueue)
{
@@ -1214,8 +1144,8 @@ static void printUsage( void )
log_info("test_printf: <optional: testnames> \n");
log_info("\tdefault is to run the full test on the default device\n");
log_info("\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 );
}
}

View File

@@ -377,7 +377,7 @@ static int copy_partial_size( cl_device_id device, cl_context context, cl_comman
} // end copy_partial_size()
int copy_array( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements )
int test_copy_array( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements )
{
int i, err = 0;
int size;
@@ -401,7 +401,7 @@ int copy_array( cl_device_id device, cl_context context, cl_command_queue queue,
} // end copy_array()
int copy_partial_array( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements )
int test_copy_partial_array( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements )
{
int i, err = 0;
int size;
@@ -692,7 +692,7 @@ static int copy_image_size( cl_device_id device, cl_context context,
} // end copy_image_size()
int copy_image( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements )
int test_copy_image( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements )
{
int err = 0;
int i;
@@ -765,7 +765,7 @@ int copy_image( cl_device_id device, cl_context context, cl_command_queue queue,
} // end copy_image()
int copy_array_to_image( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements )
int test_copy_array_to_image( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements )
{
cl_mem memobjs[3];
cl_image_format image_format_desc = { CL_RGBA, CL_UNORM_INT8 };

View File

@@ -379,7 +379,7 @@ static int basicFilter( int w, int h, int nChannels, uchar *inptr, uchar *outptr
} // end of basicFilter()
int execute( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements )
int test_execute( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements )
{
uchar *inptr;
uchar *outptr[2];

View File

@@ -26,80 +26,43 @@
cl_device_type gDeviceType = CL_DEVICE_TYPE_DEFAULT;
bool gTestRounding = false;
basefn basefn_list[] = {
read_int_array,
read_uint_array,
read_long_array,
read_ulong_array,
read_short_array,
read_ushort_array,
read_float_array,
read_char_array,
read_uchar_array,
read_struct_array,
write_int_array,
write_uint_array,
write_long_array,
write_ulong_array,
write_short_array,
write_ushort_array,
write_float_array,
write_char_array,
write_uchar_array,
write_struct_array,
read_float_image,
read_char_image,
read_uchar_image,
write_float_image,
write_char_image,
write_uchar_image,
copy_array,
copy_partial_array,
copy_image,
copy_array_to_image,
execute
test_definition test_list[] = {
ADD_TEST( read_array_int ),
ADD_TEST( read_array_uint ),
ADD_TEST( read_array_long ),
ADD_TEST( read_array_ulong ),
ADD_TEST( read_array_short ),
ADD_TEST( read_array_ushort ),
ADD_TEST( read_array_float ),
ADD_TEST( read_array_char ),
ADD_TEST( read_array_uchar ),
ADD_TEST( read_array_struct ),
ADD_TEST( write_array_int ),
ADD_TEST( write_array_uint ),
ADD_TEST( write_array_long ),
ADD_TEST( write_array_ulong ),
ADD_TEST( write_array_short ),
ADD_TEST( write_array_ushort ),
ADD_TEST( write_array_float ),
ADD_TEST( write_array_char ),
ADD_TEST( write_array_uchar ),
ADD_TEST( write_array_struct ),
ADD_TEST( read_image_float ),
ADD_TEST( read_image_char ),
ADD_TEST( read_image_uchar ),
ADD_TEST( write_image_float ),
ADD_TEST( write_image_char ),
ADD_TEST( write_image_uchar ),
ADD_TEST( copy_array ),
ADD_TEST( copy_partial_array ),
ADD_TEST( copy_image ),
ADD_TEST( copy_array_to_image ),
ADD_TEST( execute ),
};
const int test_num = ARRAY_SIZE( test_list );
const char *basefn_names[] = {
"read_array_int",
"read_array_uint",
"read_array_long",
"read_array_ulong",
"read_array_short",
"read_array_ushort",
"read_array_float",
"read_array_char",
"read_array_uchar",
"read_array_struct",
"write_array_int",
"write_array_uint",
"write_array_long",
"write_array_ulong",
"write_array_short",
"write_array_ushort",
"write_array_float",
"write_array_char",
"write_array_uchar",
"write_array_struct",
"read_image_float",
"read_image_int",
"read_image_uint",
"write_image_float",
"write_image_char",
"write_image_uchar",
"copy_array",
"copy_partial_array",
"copy_image",
"copy_array_to_image",
"execute",
};
ct_assert((sizeof(basefn_names) / sizeof(basefn_names[0])) == (sizeof(basefn_list) / sizeof(basefn_list[0])));
int num_streamfns = sizeof(basefn_names) / sizeof(char *);
// FIXME: use timer resolution rather than hardcoding 1µs per tick.
// FIXME: use timer resolution rather than hardcoding 1µs per tick.
#define QUEUE_SECONDS_LIMIT 30
#define SUBMIT_SECONDS_LIMIT 30
@@ -163,11 +126,8 @@ int check_times(cl_ulong queueStart, cl_ulong commandSubmit, cl_ulong commandSta
return err;
}
int main( int argc, const char *argv[] )
{
return runTestHarness( argc, argv, num_streamfns, basefn_list, basefn_names,
false, false, CL_QUEUE_PROFILING_ENABLE );
return runTestHarness( argc, argv, test_num, test_list, false, false, CL_QUEUE_PROFILING_ENABLE );
}

View File

@@ -24,39 +24,39 @@
extern int check_times(cl_ulong queueStart, cl_ulong submitStart, cl_ulong commandStart, cl_ulong commandEnd, cl_device_id device);
extern int read_int_array( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int read_uint_array( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int read_long_array( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int read_ulong_array( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int read_short_array( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int read_ushort_array( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int read_float_array( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int read_half_array( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int read_char_array( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int read_uchar_array( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int read_struct_array( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int write_int_array( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int write_uint_array( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int write_long_array( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int write_ulong_array( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int write_short_array( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int write_ushort_array( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int write_float_array( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int write_half_array( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int write_char_array( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int write_uchar_array( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int write_struct_array( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int read_float_image( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int read_char_image( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int read_uchar_image( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int write_float_image( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int write_char_image( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int write_uchar_image( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int copy_array( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int copy_partial_array( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int copy_image( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int copy_array_to_image( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int execute( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int test_read_array_int( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int test_read_array_uint( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int test_read_array_long( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int test_read_array_ulong( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int test_read_array_short( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int test_read_array_ushort( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int test_read_array_float( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int test_read_array_half( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int test_read_array_char( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int test_read_array_uchar( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int test_read_array_struct( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int test_write_array_int( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int test_write_array_uint( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int test_write_array_long( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int test_write_array_ulong( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int test_write_array_short( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int test_write_array_ushort( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int test_write_array_float( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int test_write_array_half( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int test_write_array_char( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int test_write_array_uchar( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int test_write_array_struct( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int test_read_image_float( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int test_read_image_char( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int test_read_image_uchar( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int test_write_image_float( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int test_write_image_char( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int test_write_image_uchar( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int test_copy_array( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int test_copy_partial_array( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int test_copy_image( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int test_copy_array_to_image( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int test_execute( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );
extern int test_parallel_kernels( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements );

View File

@@ -773,7 +773,7 @@ int test_stream_read( cl_device_id device, cl_context context, cl_command_queue
} // end test_stream_read()
int read_int_array( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements )
int test_read_array_int( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements )
{
int (*foo)(void *,int);
foo = verify_read_int;
@@ -783,7 +783,7 @@ int read_int_array( cl_device_id device, cl_context context, cl_command_queue qu
}
int read_uint_array( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements )
int test_read_array_uint( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements )
{
int (*foo)(void *,int);
foo = verify_read_uint;
@@ -793,7 +793,7 @@ int read_uint_array( cl_device_id device, cl_context context, cl_command_queue q
}
int read_long_array( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements )
int test_read_array_long( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements )
{
int (*foo)(void *,int);
foo = verify_read_long;
@@ -809,7 +809,7 @@ int read_long_array( cl_device_id device, cl_context context, cl_command_queue q
}
int read_ulong_array( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements )
int test_read_array_ulong( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements )
{
int (*foo)(void *,int);
foo = verify_read_ulong;
@@ -825,7 +825,7 @@ int read_ulong_array( cl_device_id device, cl_context context, cl_command_queue
}
int read_short_array( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements )
int test_read_array_short( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements )
{
int (*foo)(void *,int);
foo = verify_read_short;
@@ -835,7 +835,7 @@ int read_short_array( cl_device_id device, cl_context context, cl_command_queue
}
int read_ushort_array( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements )
int test_read_array_ushort( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements )
{
int (*foo)(void *,int);
foo = verify_read_ushort;
@@ -845,7 +845,7 @@ int read_ushort_array( cl_device_id device, cl_context context, cl_command_queue
}
int read_float_array( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements )
int test_read_array_float( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements )
{
int (*foo)(void *,int);
foo = verify_read_float;
@@ -855,7 +855,7 @@ int read_float_array( cl_device_id device, cl_context context, cl_command_queue
}
int read_half_array( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements )
int test_read_array_half( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements )
{
int (*foo)(void *,int);
foo = verify_read_half;
@@ -865,7 +865,7 @@ int read_half_array( cl_device_id device, cl_context context, cl_command_queue q
}
int read_char_array( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements )
int test_read_array_char( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements )
{
int (*foo)(void *,int);
foo = verify_read_char;
@@ -875,7 +875,7 @@ int read_char_array( cl_device_id device, cl_context context, cl_command_queue q
}
int read_uchar_array( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements )
int test_read_array_uchar( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements )
{
int (*foo)(void *,int);
foo = verify_read_uchar;
@@ -885,7 +885,7 @@ int read_uchar_array( cl_device_id device, cl_context context, cl_command_queue
}
int read_struct_array( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements )
int test_read_array_struct( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements )
{
int (*foo)(void *,int);
foo = verify_read_struct;

Some files were not shown because too many files have changed in this diff Show More