cl22: Use single array for function list (#148)

Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
This commit is contained in:
Radek Szymanski
2019-04-10 12:30:38 +01:00
committed by Kévin Petit
parent 394dece0d7
commit 07196c351a
139 changed files with 2380 additions and 4142 deletions

View File

@@ -17,19 +17,6 @@
#define TEST_COMMON_AUTOTEST_AUTOTEST_HPP #define TEST_COMMON_AUTOTEST_AUTOTEST_HPP
#include "test_suite.hpp" #include "test_suite.hpp"
#include "test_case.hpp"
namespace autotest {
inline std::vector<const char*> get_strings_ptrs(const std::vector<std::string>& list)
{
std::vector<const char*> v;
for(auto& s : list)
{
v.push_back(s.c_str());
}
return v;
}
}
#define STR_JOIN( X, Y ) STR_DO_JOIN( X, Y ) #define STR_JOIN( X, Y ) STR_DO_JOIN( X, Y )
#define STR_DO_JOIN( X, Y ) STR_DO_JOIN_2(X,Y) #define STR_DO_JOIN( X, Y ) STR_DO_JOIN_2(X,Y)
@@ -43,13 +30,6 @@ namespace autotest {
// (test case code...) // (test case code...)
// } // }
// //
// It automatically registers created test case to global test_suite object. Test functions
// names and pointers to those functions can be later retrieved this way:
// - std::vector<basefn> test_functions_list = autotest::test_suite::get_test_functions();
// - std::vector<std::string> test_functions_names = autotest::test_suite::get_test_names();
//
// Helper function which constructs vector of const char pointers to test functions names:
// - std::vector<const char *> test_functions_names_c_str = autotest::get_strings_ptrs(test_functions_names);
#define AUTO_TEST_CASE(name) \ #define AUTO_TEST_CASE(name) \
struct name { static int run_test(cl_device_id, cl_context, cl_command_queue, int); }; \ struct name { static int run_test(cl_device_id, cl_context, cl_command_queue, int); }; \
static autotest::detail::test_case_registration STR_JOIN(name, STR_JOIN(_registration, __LINE__)) (#name, name::run_test); \ static autotest::detail::test_case_registration STR_JOIN(name, STR_JOIN(_registration, __LINE__)) (#name, name::run_test); \

View File

@@ -1,41 +0,0 @@
//
// Copyright (c) 2017 The Khronos Group Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#ifndef TEST_COMMON_AUTOTEST_TEST_CASE_HPP
#define TEST_COMMON_AUTOTEST_TEST_CASE_HPP
#include <string>
#include "../../test_common/harness/threadTesting.h"
namespace autotest
{
struct test_case {
// Test case name
const std::string name;
// Pointer to test function.
const basefn function_pointer;
test_case(const std::string& name, const basefn function_ptr)
: name(name), function_pointer(function_ptr)
{
}
};
} // end namespace autotest
#endif // TEST_COMMON_AUTOTEST_TEST_CASE_HPP

View File

@@ -19,8 +19,6 @@
#include <vector> #include <vector>
#include <string> #include <string>
#include "test_case.hpp"
namespace autotest { namespace autotest {
struct test_suite { struct test_suite {
@@ -30,33 +28,13 @@ struct test_suite {
} }
void add(const test_case& tc) void add(const test_definition& td)
{ {
test_cases.push_back(tc); test_defs.push_back(td);
} }
static std::vector<basefn> get_test_functions() // List of test definitions
{ std::vector<test_definition> test_defs;
std::vector<basefn> v;
for(auto& tc: global_test_suite().test_cases)
{
v.push_back(tc.function_pointer);
}
return v;
}
static std::vector<std::string> get_test_names()
{
std::vector<std::string> v;
for(auto& tc : global_test_suite().test_cases)
{
v.push_back(tc.name);
}
return v;
}
// List of test cases
std::vector<test_case> test_cases;
// Test suite name // Test suite name
const std::string name; const std::string name;
@@ -73,7 +51,7 @@ struct test_case_registration
{ {
test_case_registration(const std::string& name, const basefn ptr) test_case_registration(const std::string& name, const basefn ptr)
{ {
::autotest::test_suite::global_test_suite().add(test_case(name, ptr)); ::autotest::test_suite::global_test_suite().add(test_definition({ptr, name.c_str()}));
} }
}; };

View File

@@ -48,22 +48,20 @@ int gHasLong = 1;
#define DEFAULT_NUM_ELEMENTS 0x4000 #define DEFAULT_NUM_ELEMENTS 0x4000
int runTestHarness( int argc, const char *argv[], unsigned int num_fns, int runTestHarness( int argc, const char *argv[], int testNum, test_definition testList[],
basefn fnList[], const char *fnNames[], int imageSupportRequired, int forceNoContextCreation, cl_command_queue_properties queueProps )
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 ); ( imageSupportRequired ) ? verifyImageSupport : NULL );
} }
int runTestHarnessWithCheck( int argc, const char *argv[], unsigned int num_fns, int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_definition testList[],
basefn fnList[], const char *fnNames[], int imageSupportRequired, int forceNoContextCreation, cl_command_queue_properties queueProps,
int imageSupportRequired, int forceNoContextCreation, cl_command_queue_properties queueProps, DeviceCheckFn deviceCheckFn )
DeviceCheckFn deviceCheckFn )
{ {
test_start(); 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_uint num_platforms = 0;
cl_platform_id *platforms; cl_platform_id *platforms;
cl_device_id device; cl_device_id device;
@@ -75,7 +73,6 @@ int runTestHarnessWithCheck( int argc, const char *argv[], unsigned int num_fns,
int err, ret; int err, ret;
char *endPtr; char *endPtr;
unsigned int i;
int based_on_env_var = 0; int based_on_env_var = 0;
@@ -137,15 +134,15 @@ int runTestHarnessWithCheck( int argc, const char *argv[], unsigned int num_fns,
/* Special case: just list the tests */ /* Special case: just list the tests */
if( ( argc > 1 ) && (!strcmp( argv[ 1 ], "-list" ) || !strcmp( argv[ 1 ], "-h" ) || !strcmp( argv[ 1 ], "--help" ))) 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( "\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( "\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( "\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" ); 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(); test_finish();
return 0; return 0;
@@ -468,7 +465,7 @@ int runTestHarnessWithCheck( int argc, const char *argv[], unsigned int num_fns,
DisableFTZ( &oldMode ); DisableFTZ( &oldMode );
#endif #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__) #if defined(__APPLE__) && defined(__arm__)
// Restore the old FP mode before leaving. // Restore the old FP mode before leaving.
@@ -478,23 +475,23 @@ int runTestHarnessWithCheck( int argc, const char *argv[], unsigned int num_fns,
return error; 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 ) const char *wildcard )
{ {
int found_tests = 0; int found_tests = 0;
size_t wildcard_length = strlen( wildcard ) - 1; /* -1 for the asterisk */ 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; return EXIT_FAILURE;
} }
fnsToCall[ fnIndex ] = 1; selectedTestList[ fnIndex ] = 1;
found_tests = 1; found_tests = 1;
} }
} }
@@ -508,29 +505,29 @@ static int find_wildcard_matching_functions( const char *fnNames[], unsigned cha
return EXIT_SUCCESS; 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 ) 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; return EXIT_FAILURE;
} }
else else
{ {
fnsToCall[ fnIndex ] = 1; selectedTestList[ fnIndex ] = 1;
break; break;
} }
} }
} }
if( fnIndex == num_fns ) if( fnIndex == testNum )
{ {
log_error( "ERROR: The argument '%s' did not match any test names.\n", argument ); log_error( "ERROR: The argument '%s' did not match any test names.\n", argument );
return EXIT_FAILURE; return EXIT_FAILURE;
@@ -539,18 +536,18 @@ static int find_argument_matching_function( const char *fnNames[], unsigned char
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
int parseAndCallCommandLineTests( int argc, const char *argv[], cl_device_id device, unsigned int num_fns, int parseAndCallCommandLineTests( int argc, const char *argv[], cl_device_id device, int testNum,
basefn fnList[], const char *fnNames[], int forceNoContextCreation, test_definition testList[], int forceNoContextCreation,
cl_command_queue_properties queueProps, int num_elements ) cl_command_queue_properties queueProps, int num_elements )
{ {
int ret = EXIT_SUCCESS; int ret = EXIT_SUCCESS;
unsigned char *fnsToCall = ( unsigned char* ) calloc( num_fns, 1 ); unsigned char *selectedTestList = ( unsigned char* ) calloc( testNum, 1 );
if( argc == 1 ) if( argc == 1 )
{ {
/* No actual arguments, all tests will be run. */ /* No actual arguments, all tests will be run. */
memset( fnsToCall, 1, num_fns ); memset( selectedTestList, 1, testNum );
} }
else else
{ {
@@ -558,18 +555,18 @@ int parseAndCallCommandLineTests( int argc, const char *argv[], cl_device_id dev
{ {
if( strchr( argv[ argIndex ], '*' ) != NULL ) 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 else
{ {
if( strcmp( argv[ argIndex ], "all" ) == 0 ) if( strcmp( argv[ argIndex ], "all" ) == 0 )
{ {
memset( fnsToCall, 1, num_fns ); memset( selectedTestList, 1, testNum );
break; break;
} }
else 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 ) 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 ) if( gTestsFailed == 0 )
{ {
@@ -610,30 +607,30 @@ int parseAndCallCommandLineTests( int argc, const char *argv[], cl_device_id dev
test_finish(); test_finish();
free( fnsToCall ); free( selectedTestList );
return ret; return ret;
} }
int callTestFunctions( basefn functionList[], const char *functionNames[], unsigned char functionsToCall[], int callTestFunctions( test_definition testList[], unsigned char selectedTestList[],
int numFunctions, cl_device_id deviceToUse, int forceNoContextCreation, int testNum, cl_device_id deviceToUse, int forceNoContextCreation,
int numElementsToUse, cl_command_queue_properties queueProps ) int numElementsToUse, cl_command_queue_properties queueProps )
{ {
int numErrors = 0; 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. */ /* Skip any unimplemented tests. */
if( functionList[ i ] != NULL ) if( testList[i].func != NULL )
{ {
numErrors += callSingleTestFunction( functionList[ i ], functionNames[ i ], deviceToUse, numErrors += callSingleTestFunction( testList[i], deviceToUse, forceNoContextCreation,
forceNoContextCreation, numElementsToUse, queueProps ); numElementsToUse, queueProps );
} }
else 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 // Actual function execution
int callSingleTestFunction( basefn functionToCall, const char *functionName, int callSingleTestFunction( test_definition test, cl_device_id deviceToUse, int forceNoContextCreation,
cl_device_id deviceToUse, int forceNoContextCreation, int numElementsToUse, const cl_queue_properties queueProps )
int numElementsToUse, const cl_queue_properties queueProps )
{ {
int numErrors = 0, ret; int numErrors = 0, ret;
cl_int error; cl_int error;
@@ -677,32 +673,32 @@ int callSingleTestFunction( basefn functionToCall, const char *functionName,
} }
/* Run the test and print the result */ /* Run the test and print the result */
log_info( "%s...\n", functionName ); log_info( "%s...\n", test.name );
fflush( stdout ); fflush( stdout );
error = check_opencl_version_with_testname(functionName, deviceToUse); error = check_opencl_version_with_testname(test.name, deviceToUse);
test_missing_feature(error, functionName); test_missing_feature(error, test.name);
error = check_functions_for_offline_compiler(functionName, deviceToUse); error = check_functions_for_offline_compiler(test.name, deviceToUse);
test_missing_support_offline_cmpiler(error, functionName); test_missing_support_offline_cmpiler(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 ) if( ret == TEST_NOT_IMPLEMENTED )
{ {
/* Tests can also let us know they're not implemented yet */ /* 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 else
{ {
/* Print result */ /* Print result */
if( ret == 0 ) { if( ret == 0 ) {
log_info( "%s PASSED\n", functionName ); log_info( "%s passed\n", test.name );
gTestsPassed++; gTestsPassed++;
} }
else else
{ {
numErrors++; numErrors++;
log_error( "%s FAILED\n", functionName ); log_error( "%s FAILED\n", test.name );
gTestsFailed++; gTestsFailed++;
} }
} }

View File

@@ -25,6 +25,18 @@
extern "C" { extern "C" {
#endif #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 typedef enum test_status
{ {
TEST_PASS = 0, TEST_PASS = 0,
@@ -37,39 +49,36 @@ extern cl_uint gRandomSeed;
// Supply a list of functions to test here. This will allocate a CL device, create a context, all that // 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. // 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, extern int runTestHarness( int argc, const char *argv[], int testNum, test_definition testList[],
basefn fnList[], const char *fnNames[], int imageSupportRequired, int forceNoContextCreation, cl_command_queue_properties queueProps );
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. // 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 ); typedef test_status (*DeviceCheckFn)( cl_device_id device );
// Same as runTestHarness, but also supplies a function that checks the created device for required functionality. // 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, extern int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_definition testList[],
basefn fnList[], const char *fnNames[], int imageSupportRequired, int forceNoContextCreation,
int imageSupportRequired, int forceNoContextCreation, cl_command_queue_properties queueProps, DeviceCheckFn deviceCheckFn ); cl_command_queue_properties queueProps, DeviceCheckFn deviceCheckFn );
// The command line parser used by runTestHarness to break up parameters into calls to callTestFunctions // 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, extern int parseAndCallCommandLineTests( int argc, const char *argv[], cl_device_id device, int testNum,
basefn *fnList, const char *fnNames[], test_definition testList[], int forceNoContextCreation,
int forceNoContextCreation, cl_command_queue_properties queueProps, int num_elements ); 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/ // Call this function if you need to do all the setup work yourself, and just need the function list called/
// managed. // managed.
// functionList is the actual array of functions // testList is the data structure that contains test functions and its names
// functionNames is an array of strings representing the name of each function // selectedTestList is an array of integers (treated as bools) which tell which function is to be called,
// 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 testList at index i
// each element at index i, corresponds to the element in functionList at index i // testNum is the number of tests in testList and selectedTestList
// numFunctions is the number of elements in the arrays
// contextProps are used to create a testing context for each test // contextProps are used to create a testing context for each test
// deviceToUse and numElementsToUse are all just passed to each test function // deviceToUse and numElementsToUse are all just passed to each test function
extern int callTestFunctions( basefn functionList[], const char *functionNames[], unsigned char functionsToCall[], extern int callTestFunctions( test_definition testList[], unsigned char selectedTestList[],
int numFunctions, cl_device_id deviceToUse, int forceNoContextCreation, int testNum, cl_device_id deviceToUse, int forceNoContextCreation,
int numElementsToUse, cl_command_queue_properties queueProps ); int numElementsToUse, cl_command_queue_properties queueProps );
// This function is called by callTestFunctions, once per function, to do setup, call, logging and cleanup // This function is called by callTestFunctions, once per function, to do setup, call, logging and cleanup
extern int callSingleTestFunction( basefn functionToCall, const char *functionName, extern int callSingleTestFunction( test_definition test, cl_device_id deviceToUse, int forceNoContextCreation,
cl_device_id deviceToUse, int forceNoContextCreation,
int numElementsToUse, cl_command_queue_properties queueProps ); int numElementsToUse, cl_command_queue_properties queueProps );
///// Miscellaneous steps ///// Miscellaneous steps

View File

@@ -78,20 +78,20 @@ 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 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 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_svm_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_svm_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_svm_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_svm_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_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_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_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_svm_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_svm_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_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_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_svm_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_svm_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_enqueue_api(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_migrate(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); extern int test_svm_migrate(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); 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

@@ -269,49 +269,27 @@ cl_int create_cl_objects(cl_device_id device_from_harness, const char** ppCodeSt
return 0; return 0;
} }
basefn basefn_list[] = { test_definition test_list[] = {
test_byte_granularity, ADD_TEST( svm_byte_granularity ),
test_set_kernel_exec_info_svm_ptrs, ADD_TEST( svm_set_kernel_exec_info_svm_ptrs ),
test_fine_grain_memory_consistency, ADD_TEST( svm_fine_grain_memory_consistency ),
test_fine_grain_sync_buffers, ADD_TEST( svm_fine_grain_sync_buffers ),
test_shared_address_space_fine_grain, ADD_TEST( svm_shared_address_space_fine_grain ),
test_shared_sub_buffers, ADD_TEST( svm_shared_sub_buffers ),
test_shared_address_space_fine_grain_buffers, ADD_TEST( svm_shared_address_space_fine_grain_buffers ),
test_allocate_shared_buffer, ADD_TEST( svm_allocate_shared_buffer ),
test_shared_address_space_coarse_grain_old_api, ADD_TEST( svm_shared_address_space_coarse_grain_old_api ),
test_shared_address_space_coarse_grain_new_api, ADD_TEST( svm_shared_address_space_coarse_grain_new_api ),
test_cross_buffer_pointers_coarse_grain, ADD_TEST( svm_cross_buffer_pointers_coarse_grain ),
test_svm_pointer_passing, ADD_TEST( svm_pointer_passing ),
test_enqueue_api, ADD_TEST( svm_enqueue_api ),
test_migrate, ADD_TEST( svm_migrate ),
}; };
const char *basefn_names[] = { const int test_num = ARRAY_SIZE( test_list );
"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",
"svm_migrate_mem",
};
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 main(int argc, const char *argv[]) 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; clContextWrapper context = NULL;
clProgramWrapper program = 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; clContextWrapper context;
clProgramWrapper program; 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. // 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. // 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. // 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; clContextWrapper context = NULL;
clProgramWrapper program = 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); 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; clContextWrapper context = NULL;
clCommandQueueWrapper queues[MAXQ]; clCommandQueueWrapper queues[MAXQ];

View File

@@ -127,7 +127,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 // 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. // 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. // 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; clContextWrapper context;
clProgramWrapper program; 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. // 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 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. // 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; clContextWrapper context = NULL;
clProgramWrapper program = NULL; clProgramWrapper program = NULL;

View File

@@ -73,8 +73,7 @@ wait_and_release(const char* s, cl_event* evs, int n)
return 0; return 0;
} }
int int test_svm_migrate(cl_device_id deviceID, cl_context c, cl_command_queue queue, int num_elements)
test_migrate(cl_device_id deviceID, cl_context c, cl_command_queue queue, int num_elements)
{ {
cl_uint amem[GLOBAL_SIZE]; cl_uint amem[GLOBAL_SIZE];
cl_uint bmem[GLOBAL_SIZE]; cl_uint bmem[GLOBAL_SIZE];

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. // 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; clContextWrapper c = NULL;
clProgramWrapper program = 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; 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); 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); 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 // 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 // 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. // 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; clContextWrapper context = NULL;
clProgramWrapper program = 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 // 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 // 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. // 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; clContextWrapper context = NULL;
clProgramWrapper program = 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. // 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. // 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. // 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; clContextWrapper context = NULL;
clProgramWrapper program = NULL; clProgramWrapper program = NULL;

View File

@@ -221,27 +221,16 @@ int test_image2d_write_non_blocking(cl_device_id deviceID, cl_context context, c
return doTest( IMAGE_WRITE_NON_BLOCKING ); return doTest( IMAGE_WRITE_NON_BLOCKING );
} }
basefn basefn_list[] = { test_definition test_list[] = {
test_buffer, ADD_TEST( buffer ),
test_image2d_read, ADD_TEST( image2d_read ),
test_image2d_write, ADD_TEST( image2d_write ),
test_buffer_non_blocking, ADD_TEST( buffer_non_blocking ),
test_image2d_read_non_blocking, ADD_TEST( image2d_read_non_blocking ),
test_image2d_write_non_blocking, ADD_TEST( image2d_write_non_blocking ),
}; };
const char *basefn_names[] = { const int test_num = ARRAY_SIZE( test_list );
"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 *);
int main(int argc, const char *argv[]) int main(int argc, const char *argv[])
{ {
@@ -401,7 +390,7 @@ int main(int argc, const char *argv[])
g_global_mem_size *= 0.60; 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); free(argList);
@@ -430,8 +419,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( "\tdo_not_execute - Disable executing a kernel that accesses all of the memory objects.\n" );
log_info( "\n" ); log_info( "\n" );
log_info( "Test names (Allocation Types):\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,193 +31,99 @@
cl_device_type gDeviceType = CL_DEVICE_TYPE_DEFAULT; cl_device_type gDeviceType = CL_DEVICE_TYPE_DEFAULT;
bool gTestRounding = false; bool gTestRounding = false;
basefn basefn_list[] = { test_definition test_list[] = {
test_get_platform_info, ADD_TEST( get_platform_info ),
test_get_sampler_info, ADD_TEST( get_sampler_info ),
test_get_command_queue_info, ADD_TEST( get_command_queue_info ),
test_get_context_info, ADD_TEST( get_context_info ),
test_get_device_info, ADD_TEST( get_device_info ),
test_enqueue_task, ADD_TEST( enqueue_task ),
test_binary_get, ADD_TEST( binary_get ),
test_program_binary_create, ADD_TEST( binary_create ),
test_kernel_required_group_size, ADD_TEST( kernel_required_group_size ),
test_release_kernel_order, ADD_TEST( release_kernel_order ),
test_release_during_execute, ADD_TEST( release_during_execute ),
test_load_single_kernel, ADD_TEST( load_single_kernel ),
test_load_two_kernels, ADD_TEST( load_two_kernels ),
test_load_two_kernels_in_one, ADD_TEST( load_two_kernels_in_one ),
test_load_two_kernels_manually, ADD_TEST( load_two_kernels_manually ),
test_get_program_info_kernel_names, ADD_TEST( get_program_info_kernel_names ),
test_get_kernel_arg_info, ADD_TEST( get_kernel_arg_info ),
test_create_kernels_in_program, ADD_TEST( create_kernels_in_program ),
test_get_kernel_info, ADD_TEST( get_kernel_info ),
test_execute_kernel_local_sizes, ADD_TEST( execute_kernel_local_sizes ),
test_set_kernel_arg_by_index, ADD_TEST( set_kernel_arg_by_index ),
test_set_kernel_arg_constant, ADD_TEST( set_kernel_arg_constant ),
test_set_kernel_arg_struct_array, ADD_TEST( set_kernel_arg_struct_array ),
test_kernel_global_constant, ADD_TEST( kernel_global_constant ),
test_min_max_thread_dimensions, ADD_TEST( min_max_thread_dimensions ),
test_min_max_work_items_sizes, ADD_TEST( min_max_work_items_sizes ),
test_min_max_work_group_size, ADD_TEST( min_max_work_group_size ),
test_min_max_read_image_args, ADD_TEST( min_max_read_image_args ),
test_min_max_write_image_args, ADD_TEST( min_max_write_image_args ),
test_min_max_mem_alloc_size, ADD_TEST( min_max_mem_alloc_size ),
test_min_max_image_2d_width, ADD_TEST( min_max_image_2d_width ),
test_min_max_image_2d_height, ADD_TEST( min_max_image_2d_height ),
test_min_max_image_3d_width, ADD_TEST( min_max_image_3d_width ),
test_min_max_image_3d_height, ADD_TEST( min_max_image_3d_height ),
test_min_max_image_3d_depth, ADD_TEST( min_max_image_3d_depth ),
test_min_max_image_array_size, ADD_TEST( min_max_image_array_size ),
test_min_max_image_buffer_size, ADD_TEST( min_max_image_buffer_size ),
test_min_max_parameter_size, ADD_TEST( min_max_parameter_size ),
test_min_max_samplers, ADD_TEST( min_max_samplers ),
test_min_max_constant_buffer_size, ADD_TEST( min_max_constant_buffer_size ),
test_min_max_constant_args, ADD_TEST( min_max_constant_args ),
test_min_max_compute_units, ADD_TEST( min_max_compute_units ),
test_min_max_address_bits, ADD_TEST( min_max_address_bits ),
test_min_max_single_fp_config, ADD_TEST( min_max_single_fp_config ),
test_min_max_double_fp_config, ADD_TEST( min_max_double_fp_config ),
test_min_max_local_mem_size, ADD_TEST( min_max_local_mem_size ),
test_min_max_kernel_preferred_work_group_size_multiple, ADD_TEST( min_max_kernel_preferred_work_group_size_multiple ),
test_min_max_execution_capabilities, ADD_TEST( min_max_execution_capabilities ),
test_min_max_queue_properties, ADD_TEST( min_max_queue_properties ),
test_min_max_device_version, ADD_TEST( min_max_device_version ),
test_min_max_language_version, ADD_TEST( min_max_language_version ),
test_kernel_arg_changes, ADD_TEST( kernel_arg_changes ),
test_kernel_arg_multi_setup_random, 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, ADD_TEST( platform_extensions ),
test_get_platform_ids, ADD_TEST( get_platform_ids ),
test_for_bool_type, ADD_TEST( bool_type ),
test_repeated_setup_cleanup, ADD_TEST( repeated_setup_cleanup ),
test_retain_queue_single, ADD_TEST( retain_queue_single ),
test_retain_queue_multiple, ADD_TEST( retain_queue_multiple ),
test_retain_mem_object_single, ADD_TEST( retain_mem_object_single ),
test_retain_mem_object_multiple, ADD_TEST( retain_mem_object_multiple ),
test_min_data_type_align_size_alignment, ADD_TEST( min_data_type_align_size_alignment ),
test_mem_object_destructor_callback, ADD_TEST( mem_object_destructor_callback ),
test_null_buffer_arg, ADD_TEST( null_buffer_arg ),
test_get_buffer_info, ADD_TEST( get_buffer_info ),
test_get_image2d_info, ADD_TEST( get_image2d_info ),
test_get_image3d_info, ADD_TEST( get_image3d_info ),
test_get_image1d_info, ADD_TEST( get_image1d_info ),
test_get_image1d_array_info, ADD_TEST( get_image1d_array_info ),
test_get_image2d_array_info, ADD_TEST( get_image2d_array_info ),
test_queue_hint, ADD_TEST( queue_hint ),
test_sub_group_dispatch, ADD_TEST( sub_group_dispatch ),
test_clone_kernel, ADD_TEST( clone_kernel ),
test_zero_sized_enqueue ADD_TEST( zero_sized_enqueue ),
}; };
const int test_num = ARRAY_SIZE( test_list );
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_hint",
"sub_group_dispatch",
"clone_kernel",
"zero_sized_enqueue",
};
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 main(int argc, const char *argv[]) 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_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_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_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_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); 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_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_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_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); extern int test_release_during_execute(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);

View File

@@ -71,7 +71,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 /* 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 */ 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" "}\n"
}; };
int test_for_bool_type(cl_device_id deviceID, cl_context context, int test_bool_type(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
cl_command_queue queue, int num_elements)
{ {
cl_program program; cl_program program;

View File

@@ -24,48 +24,27 @@
#include <unistd.h> #include <unistd.h>
#endif #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[] = { ADD_TEST( atomic_add_index ),
test_atomic_add, ADD_TEST( atomic_add_index_bin ),
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
}; };
const char *basefn_names[] = { const int test_num = ARRAY_SIZE( test_list );
"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 *);
int main(int argc, const char *argv[]) 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; cl_device_type gDeviceType = CL_DEVICE_TYPE_DEFAULT;
bool gTestRounding = false; bool gTestRounding = false;
basefn basefn_list[] = { test_definition test_list[] = {
test_hostptr, ADD_TEST( hostptr ),
test_fpmath_float, ADD_TEST( fpmath_float ),
test_fpmath_float2, ADD_TEST( fpmath_float2 ),
test_fpmath_float4, ADD_TEST( fpmath_float4 ),
test_intmath_int, ADD_TEST( intmath_int ),
test_intmath_int2, ADD_TEST( intmath_int2 ),
test_intmath_int4, ADD_TEST( intmath_int4 ),
test_intmath_long, ADD_TEST( intmath_long ),
test_intmath_long2, ADD_TEST( intmath_long2 ),
test_intmath_long4, ADD_TEST( intmath_long4 ),
test_hiloeo, ADD_TEST( hiloeo ),
test_if, ADD_TEST( if ),
test_sizeof, ADD_TEST( sizeof ),
test_loop, ADD_TEST( loop ),
test_pointer_cast, ADD_TEST( pointer_cast ),
test_local_arg_def, ADD_TEST( local_arg_def ),
test_local_kernel_def, ADD_TEST( local_kernel_def ),
test_local_kernel_scope, ADD_TEST( local_kernel_scope ),
test_constant, ADD_TEST( constant ),
test_constant_source, ADD_TEST( constant_source ),
test_readimage, ADD_TEST( readimage ),
test_readimage_int16, ADD_TEST( readimage_int16 ),
test_readimage_fp32, ADD_TEST( readimage_fp32 ),
test_writeimage, ADD_TEST( writeimage ),
test_writeimage_int16, ADD_TEST( writeimage_int16 ),
test_writeimage_fp32, ADD_TEST( writeimage_fp32 ),
test_multireadimageonefmt, ADD_TEST( mri_one ),
test_multireadimagemultifmt, ADD_TEST( mri_multiple ),
test_image_r8, ADD_TEST( image_r8 ),
test_barrier, ADD_TEST( barrier ),
test_wg_barrier, ADD_TEST( wg_barrier ),
test_int2float, ADD_TEST( int2float ),
test_float2int, ADD_TEST( float2int ),
test_imagereadwrite, ADD_TEST( imagereadwrite ),
test_imagereadwrite3d, ADD_TEST( imagereadwrite3d ),
test_readimage3d, ADD_TEST( readimage3d ),
test_readimage3d_int16, ADD_TEST( readimage3d_int16 ),
test_readimage3d_fp32, ADD_TEST( readimage3d_fp32 ),
test_bufferreadwriterect, ADD_TEST( bufferreadwriterect ),
test_arrayreadwrite, ADD_TEST( arrayreadwrite ),
test_arraycopy, ADD_TEST( arraycopy ),
test_imagearraycopy, ADD_TEST( imagearraycopy ),
test_imagearraycopy3d, ADD_TEST( imagearraycopy3d ),
test_imagecopy, ADD_TEST( imagecopy ),
test_imagecopy3d, ADD_TEST( imagecopy3d ),
test_imagerandomcopy, ADD_TEST( imagerandomcopy ),
test_arrayimagecopy, ADD_TEST( arrayimagecopy ),
test_arrayimagecopy3d, ADD_TEST( arrayimagecopy3d ),
test_imagenpot, ADD_TEST( imagenpot ),
test_vload_global, ADD_TEST( vload_global ),
test_vload_local, ADD_TEST( vload_local ),
test_vload_constant, ADD_TEST( vload_constant ),
test_vload_private, ADD_TEST( vload_private ),
test_vstore_global, ADD_TEST( vstore_global ),
test_vstore_local, ADD_TEST( vstore_local ),
test_vstore_private, ADD_TEST( vstore_private ),
test_createkernelsinprogram, ADD_TEST( createkernelsinprogram ),
test_imagedim_pow2, ADD_TEST( imagedim_pow2 ),
test_imagedim_non_pow2, ADD_TEST( imagedim_non_pow2 ),
test_image_param, ADD_TEST( image_param ),
test_image_multipass_integer_coord, ADD_TEST( image_multipass_integer_coord ),
test_image_multipass_float_coord, ADD_TEST( image_multipass_float_coord ),
test_explicit_s2v_bool, ADD_TEST( explicit_s2v_bool ),
test_explicit_s2v_char, ADD_TEST( explicit_s2v_char ),
test_explicit_s2v_uchar, ADD_TEST( explicit_s2v_uchar ),
test_explicit_s2v_short, ADD_TEST( explicit_s2v_short ),
test_explicit_s2v_ushort, ADD_TEST( explicit_s2v_ushort ),
test_explicit_s2v_int, ADD_TEST( explicit_s2v_int ),
test_explicit_s2v_uint, ADD_TEST( explicit_s2v_uint ),
test_explicit_s2v_long, ADD_TEST( explicit_s2v_long ),
test_explicit_s2v_ulong, ADD_TEST( explicit_s2v_ulong ),
test_explicit_s2v_float, ADD_TEST( explicit_s2v_float ),
test_explicit_s2v_double, ADD_TEST( explicit_s2v_double ),
test_enqueue_map_buffer, ADD_TEST( enqueue_map_buffer ),
test_enqueue_map_image, 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, ADD_TEST( async_copy_global_to_local ),
test_async_copy_local_to_global, ADD_TEST( async_copy_local_to_global ),
test_async_strided_copy_global_to_local, ADD_TEST( async_strided_copy_global_to_local ),
test_async_strided_copy_local_to_global, ADD_TEST( async_strided_copy_local_to_global ),
test_prefetch, ADD_TEST( prefetch ),
test_kernel_call_kernel_function, ADD_TEST( kernel_call_kernel_function ),
test_host_numeric_constants, ADD_TEST( host_numeric_constants ),
test_kernel_numeric_constants, ADD_TEST( kernel_numeric_constants ),
test_kernel_limit_constants, ADD_TEST( kernel_limit_constants ),
test_kernel_preprocessor_macros, ADD_TEST( kernel_preprocessor_macros ),
test_basic_parameter_types, ADD_TEST( parameter_types ),
test_vector_creation, ADD_TEST( vector_creation ),
test_vec_type_hint, ADD_TEST( vec_type_hint ),
test_kernel_memory_alignment_local, ADD_TEST( kernel_memory_alignment_local ),
test_kernel_memory_alignment_global, ADD_TEST( kernel_memory_alignment_global ),
test_kernel_memory_alignment_constant, ADD_TEST( kernel_memory_alignment_constant ),
test_kernel_memory_alignment_private, ADD_TEST( kernel_memory_alignment_private ),
test_progvar_prog_scope_misc, ADD_TEST( progvar_prog_scope_misc ),
test_progvar_prog_scope_uninit, ADD_TEST( progvar_prog_scope_uninit ),
test_progvar_prog_scope_init, ADD_TEST( progvar_prog_scope_init ),
test_progvar_func_scope, ADD_TEST( progvar_func_scope ),
test_global_work_offsets, ADD_TEST( global_work_offsets ),
test_get_global_offset, ADD_TEST( get_global_offset ),
test_global_linear_id, ADD_TEST( global_linear_id ),
test_local_linear_id, ADD_TEST( local_linear_id ),
test_enqueued_local_size, ADD_TEST( enqueued_local_size ),
test_simple_read_image_pitch, ADD_TEST( simple_read_image_pitch ),
test_simple_write_image_pitch, ADD_TEST( simple_write_image_pitch ),
#if defined( __APPLE__ ) #if defined( __APPLE__ )
test_queue_priority, ADD_TEST( queue_priority ),
#endif #endif
test_get_linear_ids, ADD_TEST( get_linear_ids ),
test_rw_image_access_qualifier ADD_TEST( rw_image_access_qualifier ),
}; };
const char *basefn_names[] = { const int test_num = ARRAY_SIZE( test_list );
"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 *);
int main(int argc, const char *argv[]) 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(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_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_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_mri_one(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_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_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_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); 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_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_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); 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" " result[1] = %s(ul);\n"
"}\n"; "}\n";
int int test_parameter_types_long(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
test_basic_parameter_types_long(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
{ {
clMemWrapper results; clMemWrapper results;
int error; int error;
size_t global[3] = {1, 1, 1}; size_t global[3] = {1, 1, 1};
float results_back[2*16]; 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; return total_errors;
} }
int int test_parameter_types(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
test_basic_parameter_types(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
{ {
clMemWrapper results; clMemWrapper results;
int error; int error;
size_t global[3] = {1, 1, 1}; size_t global[3] = {1, 1, 1};
float results_back[7*16]; 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) { if (gHasLong) {
log_info("Testing long types...\n"); 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 { else {
log_info("Longs unsupported, skipping."); log_info("Longs unsupported, skipping.");

View File

@@ -111,7 +111,7 @@ verify_multireadimage(void *image[], float *outptr, int w, int h)
int 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_mem streams[4];
cl_image_format img_format; 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_mem streams[8];
cl_image_format img_format; 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_mem memobj;
cl_int err; cl_int err;

View File

@@ -21,208 +21,108 @@
#include "procs.h" #include "procs.h"
#include "../../test_common/harness/testHarness.h" #include "../../test_common/harness/testHarness.h"
basefn bufferfn_list[] = { test_definition test_list[] = {
test_buffer_read_async_int, ADD_TEST( buffer_read_async_int ),
test_buffer_read_async_uint, ADD_TEST( buffer_read_async_uint ),
test_buffer_read_async_long, ADD_TEST( buffer_read_async_long ),
test_buffer_read_async_ulong, ADD_TEST( buffer_read_async_ulong ),
test_buffer_read_async_short, ADD_TEST( buffer_read_async_short ),
test_buffer_read_async_ushort, ADD_TEST( buffer_read_async_ushort ),
test_buffer_read_async_char, ADD_TEST( buffer_read_async_char ),
test_buffer_read_async_uchar, ADD_TEST( buffer_read_async_uchar ),
test_buffer_read_async_float, ADD_TEST( buffer_read_async_float ),
test_buffer_read_array_barrier_int, ADD_TEST( buffer_read_array_barrier_int ),
test_buffer_read_array_barrier_uint, ADD_TEST( buffer_read_array_barrier_uint ),
test_buffer_read_array_barrier_long, ADD_TEST( buffer_read_array_barrier_long ),
test_buffer_read_array_barrier_ulong, ADD_TEST( buffer_read_array_barrier_ulong ),
test_buffer_read_array_barrier_short, ADD_TEST( buffer_read_array_barrier_short ),
test_buffer_read_array_barrier_ushort, ADD_TEST( buffer_read_array_barrier_ushort ),
test_buffer_read_array_barrier_char, ADD_TEST( buffer_read_array_barrier_char ),
test_buffer_read_array_barrier_uchar, ADD_TEST( buffer_read_array_barrier_uchar ),
test_buffer_read_array_barrier_float, ADD_TEST( buffer_read_array_barrier_float ),
test_buffer_read_int, ADD_TEST( buffer_read_int ),
test_buffer_read_uint, ADD_TEST( buffer_read_uint ),
test_buffer_read_long, ADD_TEST( buffer_read_long ),
test_buffer_read_ulong, ADD_TEST( buffer_read_ulong ),
test_buffer_read_short, ADD_TEST( buffer_read_short ),
test_buffer_read_ushort, ADD_TEST( buffer_read_ushort ),
test_buffer_read_float, ADD_TEST( buffer_read_float ),
0, //test_buffer_read_half, NOT_IMPLEMENTED_TEST( buffer_read_half ),
test_buffer_read_char, ADD_TEST( buffer_read_char ),
test_buffer_read_uchar, ADD_TEST( buffer_read_uchar ),
test_buffer_read_struct, ADD_TEST( buffer_read_struct ),
test_buffer_read_random_size, ADD_TEST( buffer_read_random_size ),
test_buffer_map_read_int, ADD_TEST( buffer_map_read_int ),
test_buffer_map_read_uint, ADD_TEST( buffer_map_read_uint ),
test_buffer_map_read_long, ADD_TEST( buffer_map_read_long ),
test_buffer_map_read_ulong, ADD_TEST( buffer_map_read_ulong ),
test_buffer_map_read_short, ADD_TEST( buffer_map_read_short ),
test_buffer_map_read_ushort, ADD_TEST( buffer_map_read_ushort ),
test_buffer_map_read_char, ADD_TEST( buffer_map_read_char ),
test_buffer_map_read_uchar, ADD_TEST( buffer_map_read_uchar ),
test_buffer_map_read_float, ADD_TEST( buffer_map_read_float ),
test_buffer_map_read_struct, ADD_TEST( buffer_map_read_struct ),
test_buffer_map_write_int, ADD_TEST( buffer_map_write_int ),
test_buffer_map_write_uint, ADD_TEST( buffer_map_write_uint ),
test_buffer_map_write_long, ADD_TEST( buffer_map_write_long ),
test_buffer_map_write_ulong, ADD_TEST( buffer_map_write_ulong ),
test_buffer_map_write_short, ADD_TEST( buffer_map_write_short ),
test_buffer_map_write_ushort, ADD_TEST( buffer_map_write_ushort ),
test_buffer_map_write_char, ADD_TEST( buffer_map_write_char ),
test_buffer_map_write_uchar, ADD_TEST( buffer_map_write_uchar ),
test_buffer_map_write_float, ADD_TEST( buffer_map_write_float ),
test_buffer_map_write_struct, ADD_TEST( buffer_map_write_struct ),
test_buffer_write_int, ADD_TEST( buffer_write_int ),
test_buffer_write_uint, ADD_TEST( buffer_write_uint ),
test_buffer_write_short, ADD_TEST( buffer_write_short ),
test_buffer_write_ushort, ADD_TEST( buffer_write_ushort ),
test_buffer_write_char, ADD_TEST( buffer_write_char ),
test_buffer_write_uchar, ADD_TEST( buffer_write_uchar ),
test_buffer_write_float, ADD_TEST( buffer_write_float ),
0, //test_buffer_write_half, NOT_IMPLEMENTED_TEST( buffer_write_half ),
test_buffer_write_long, ADD_TEST( buffer_write_long ),
test_buffer_write_ulong, ADD_TEST( buffer_write_ulong ),
test_buffer_write_struct, ADD_TEST( buffer_write_struct ),
test_buffer_write_async_int, ADD_TEST( buffer_write_async_int ),
test_buffer_write_async_uint, ADD_TEST( buffer_write_async_uint ),
test_buffer_write_async_short, ADD_TEST( buffer_write_async_short ),
test_buffer_write_async_ushort, ADD_TEST( buffer_write_async_ushort ),
test_buffer_write_async_char, ADD_TEST( buffer_write_async_char ),
test_buffer_write_async_uchar, ADD_TEST( buffer_write_async_uchar ),
test_buffer_write_async_float, ADD_TEST( buffer_write_async_float ),
test_buffer_write_async_long, ADD_TEST( buffer_write_async_long ),
test_buffer_write_async_ulong, ADD_TEST( buffer_write_async_ulong ),
test_buffer_copy, ADD_TEST( buffer_copy ),
test_buffer_partial_copy, ADD_TEST( buffer_partial_copy ),
test_mem_read_write_flags, ADD_TEST( mem_read_write_flags ),
test_mem_write_flags, ADD_TEST( mem_write_only_flags ),
test_mem_read_flags, ADD_TEST( mem_read_only_flags ),
test_mem_copy_host_flags, ADD_TEST( mem_copy_host_flags ),
0, //test_mem_alloc_ref_flags, NOT_IMPLEMENTED_TEST( mem_alloc_ref_flags ),
testBufferSize, ADD_TEST( array_info_size ),
test_sub_buffers_read_write, ADD_TEST( sub_buffers_read_write ),
test_sub_buffers_read_write_dual_devices, ADD_TEST( sub_buffers_read_write_dual_devices ),
test_sub_buffers_overlapping, ADD_TEST( sub_buffers_overlapping ),
test_buffer_fill_int, ADD_TEST( buffer_fill_int ),
test_buffer_fill_uint, ADD_TEST( buffer_fill_uint ),
test_buffer_fill_short, ADD_TEST( buffer_fill_short ),
test_buffer_fill_ushort, ADD_TEST( buffer_fill_ushort ),
test_buffer_fill_char, ADD_TEST( buffer_fill_char ),
test_buffer_fill_uchar, ADD_TEST( buffer_fill_uchar ),
test_buffer_fill_long, ADD_TEST( buffer_fill_long ),
test_buffer_fill_ulong, ADD_TEST( buffer_fill_ulong ),
test_buffer_fill_float, ADD_TEST( buffer_fill_float ),
test_buffer_fill_struct, ADD_TEST( buffer_fill_struct ),
test_buffer_migrate, ADD_TEST( buffer_migrate ),
test_image_migrate, ADD_TEST( image_migrate ),
}; };
const char *bufferfn_names[] = { const int test_num = ARRAY_SIZE( test_list );
"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 cl_mem_flags flag_set[] = { const cl_mem_flags flag_set[] = {
CL_MEM_ALLOC_HOST_PTR, CL_MEM_ALLOC_HOST_PTR,
@@ -241,6 +141,5 @@ const char* flag_set_names[] = {
int main( int argc, const char *argv[] ) int main( int argc, const char *argv[] )
{ {
return runTestHarness( argc, argv, num_bufferfns, bufferfn_list, bufferfn_names, return runTestHarness( argc, argv, test_num, test_list, false, false, 0 );
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_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_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 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_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_write_only_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_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_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_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 ); 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() } // 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]; cl_mem buffers[1];
int *inptr, *outptr; 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() } // 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]; cl_mem buffers[2];
int *inptr, *outptr; 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_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_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_svm_atomic_init(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_svm_atomic_store(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_svm_atomic_load(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_svm_atomic_store_load(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_svm_atomic_exchange(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_svm_atomic_compare_exchange_weak(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_svm_atomic_compare_exchange_strong(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_svm_atomic_fetch_add(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_svm_atomic_fetch_sub(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_svm_atomic_fetch_and(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_svm_atomic_fetch_or(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_svm_atomic_fetch_orand(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_svm_atomic_fetch_xor(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_svm_atomic_fetch_xor2(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_svm_atomic_fetch_min(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_svm_atomic_fetch_max(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_svm_atomic_flag(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_fence(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
basefn basefn_list[] = { test_definition test_list[] = {
test_atomic_init, ADD_TEST( atomic_init ),
test_atomic_store, ADD_TEST( atomic_store ),
test_atomic_load, ADD_TEST( atomic_load ),
test_atomic_exchange, ADD_TEST( atomic_exchange ),
test_atomic_compare_exchange_weak, ADD_TEST( atomic_compare_exchange_weak ),
test_atomic_compare_exchange_strong, ADD_TEST( atomic_compare_exchange_strong ),
test_atomic_fetch_add, ADD_TEST( atomic_fetch_add ),
test_atomic_fetch_sub, ADD_TEST( atomic_fetch_sub ),
test_atomic_fetch_and, ADD_TEST( atomic_fetch_and ),
test_atomic_fetch_or, ADD_TEST( atomic_fetch_or ),
test_atomic_fetch_orand, ADD_TEST( atomic_fetch_orand ),
test_atomic_fetch_xor, ADD_TEST( atomic_fetch_xor ),
test_atomic_fetch_xor2, ADD_TEST( atomic_fetch_xor2 ),
test_atomic_fetch_min, ADD_TEST( atomic_fetch_min ),
test_atomic_fetch_max, ADD_TEST( atomic_fetch_max ),
test_atomic_flag, ADD_TEST( atomic_flag ),
test_atomic_fence, ADD_TEST( atomic_fence ),
test_atomic_init_svm, ADD_TEST( svm_atomic_init ),
test_atomic_store_svm, ADD_TEST( svm_atomic_store ),
test_atomic_load_svm, ADD_TEST( svm_atomic_load ),
test_atomic_exchange_svm, ADD_TEST( svm_atomic_exchange ),
test_atomic_compare_exchange_weak_svm, ADD_TEST( svm_atomic_compare_exchange_weak ),
test_atomic_compare_exchange_strong_svm, ADD_TEST( svm_atomic_compare_exchange_strong ),
test_atomic_fetch_add_svm, ADD_TEST( svm_atomic_fetch_add ),
test_atomic_fetch_sub_svm, ADD_TEST( svm_atomic_fetch_sub ),
test_atomic_fetch_and_svm, ADD_TEST( svm_atomic_fetch_and ),
test_atomic_fetch_or_svm, ADD_TEST( svm_atomic_fetch_or ),
test_atomic_fetch_orand_svm, ADD_TEST( svm_atomic_fetch_orand ),
test_atomic_fetch_xor_svm, ADD_TEST( svm_atomic_fetch_xor ),
test_atomic_fetch_xor2_svm, ADD_TEST( svm_atomic_fetch_xor2 ),
test_atomic_fetch_min_svm, ADD_TEST( svm_atomic_fetch_min ),
test_atomic_fetch_max_svm, ADD_TEST( svm_atomic_fetch_max ),
test_atomic_flag_svm, ADD_TEST( svm_atomic_flag ),
test_atomic_fence_svm ADD_TEST( svm_atomic_fence ),
}; };
const char *basefn_names[] = { const int test_num = ARRAY_SIZE( test_list );
"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 *);
int main(int argc, const char *argv[]) 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("*** Use of this mode is not sufficient to verify correctness. ***\n");
log_info("*** ***\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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); return test_atomic_fence_generic(deviceID, context, queue, num_elements, true);
} }

View File

@@ -20,11 +20,6 @@
int main(int argc, const char *argv[]) int main(int argc, const char *argv[])
{ {
// Get list to all test functions auto& tests = autotest::test_suite::global_test_suite().test_defs;
std::vector<basefn> testfn_list = autotest::test_suite::get_test_functions(); return runTestHarness(argc, argv, tests.size(), tests.data(), false, false, 0);
// Get names of all test functions
std::vector<std::string> testfn_names = autotest::test_suite::get_test_names();
// Create a vector of pointers to the names test functions
std::vector<const char *> testfn_names_c_str = autotest::get_strings_ptrs(testfn_names);
return runTestHarness(argc, argv, testfn_list.size(), testfn_list.data(), testfn_names_c_str.data(), false, false, 0);
} }

View File

@@ -22,11 +22,6 @@
int main(int argc, const char *argv[]) int main(int argc, const char *argv[])
{ {
// Get list to all test functions auto& tests = autotest::test_suite::global_test_suite().test_defs;
std::vector<basefn> testfn_list = autotest::test_suite::get_test_functions(); return runTestHarness(argc, argv, tests.size(), tests.data(), false, false, 0);
// Get names of all test functions
std::vector<std::string> testfn_names = autotest::test_suite::get_test_names();
// Create a vector of pointers to the names test functions
std::vector<const char *> testfn_names_c_str = autotest::get_strings_ptrs(testfn_names);
return runTestHarness(argc, argv, testfn_list.size(), testfn_list.data(), testfn_names_c_str.data(), false, false, 0);
} }

View File

@@ -20,11 +20,6 @@
int main(int argc, const char *argv[]) int main(int argc, const char *argv[])
{ {
// Get list to all test functions auto& tests = autotest::test_suite::global_test_suite().test_defs;
std::vector<basefn> testfn_list = autotest::test_suite::get_test_functions(); return runTestHarness(argc, argv, tests.size(), tests.data(), false, false, 0);
// Get names of all test functions
std::vector<std::string> testfn_names = autotest::test_suite::get_test_names();
// Create a vector of pointers to the names test functions
std::vector<const char *> testfn_names_c_str = autotest::get_strings_ptrs(testfn_names);
return runTestHarness(argc, argv, testfn_list.size(), testfn_list.data(), testfn_names_c_str.data(), false, false, 0);
} }

View File

@@ -22,11 +22,6 @@
int main(int argc, const char *argv[]) int main(int argc, const char *argv[])
{ {
// Get list to all test functions auto& tests = autotest::test_suite::global_test_suite().test_defs;
std::vector<basefn> testfn_list = autotest::test_suite::get_test_functions(); return runTestHarness(argc, argv, tests.size(), tests.data(), false, false, 0);
// Get names of all test functions
std::vector<std::string> testfn_names = autotest::test_suite::get_test_names();
// Create a vector of pointers to the names test functions
std::vector<const char *> testfn_names_c_str = autotest::get_strings_ptrs(testfn_names);
return runTestHarness(argc, argv, testfn_list.size(), testfn_list.data(), testfn_names_c_str.data(), false, false, 0);
} }

View File

@@ -38,11 +38,6 @@ int main(int argc, const char *argv[])
); );
} }
// Get list to all test functions auto& tests = autotest::test_suite::global_test_suite().test_defs;
std::vector<basefn> testfn_list = autotest::test_suite::get_test_functions(); return runTestHarness(argc, argv, tests.size(), tests.data(), false, false, 0);
// Get names of all test functions
std::vector<std::string> testfn_names = autotest::test_suite::get_test_names();
// Create a vector of pointers to the names test functions
std::vector<const char *> testfn_names_c_str = autotest::get_strings_ptrs(testfn_names);
return runTestHarness(argc, argv, testfn_list.size(), testfn_list.data(), testfn_names_c_str.data(), false, false, 0);
} }

View File

@@ -20,11 +20,6 @@
int main(int argc, const char *argv[]) int main(int argc, const char *argv[])
{ {
// Get list to all test functions auto& tests = autotest::test_suite::global_test_suite().test_defs;
std::vector<basefn> testfn_list = autotest::test_suite::get_test_functions(); return runTestHarness(argc, argv, tests.size(), tests.data(), false, false, 0);
// Get names of all test functions
std::vector<std::string> testfn_names = autotest::test_suite::get_test_names();
// Create a vector of pointers to the names test functions
std::vector<const char *> testfn_names_c_str = autotest::get_strings_ptrs(testfn_names);
return runTestHarness(argc, argv, testfn_list.size(), testfn_list.data(), testfn_names_c_str.data(), false, false, 0);
} }

View File

@@ -20,11 +20,6 @@
int main(int argc, const char *argv[]) int main(int argc, const char *argv[])
{ {
// Get list to all test functions auto& tests = autotest::test_suite::global_test_suite().test_defs;
std::vector<basefn> testfn_list = autotest::test_suite::get_test_functions(); return runTestHarness(argc, argv, tests.size(), tests.data(), false, false, 0);
// Get names of all test functions
std::vector<std::string> testfn_names = autotest::test_suite::get_test_names();
// Create a vector of pointers to the names test functions
std::vector<const char *> testfn_names_c_str = autotest::get_strings_ptrs(testfn_names);
return runTestHarness(argc, argv, testfn_list.size(), testfn_list.data(), testfn_names_c_str.data(), false, false, 0);
} }

View File

@@ -39,11 +39,6 @@ int main(int argc, const char *argv[])
); );
} }
// Get list to all test functions auto& tests = autotest::test_suite::global_test_suite().test_defs;
std::vector<basefn> testfn_list = autotest::test_suite::get_test_functions(); return runTestHarness(argc, argv, tests.size(), tests.data(), false, false, 0);
// Get names of all test functions
std::vector<std::string> testfn_names = autotest::test_suite::get_test_names();
// Create a vector of pointers to the names test functions
std::vector<const char *> testfn_names_c_str = autotest::get_strings_ptrs(testfn_names);
return runTestHarness(argc, argv, testfn_list.size(), testfn_list.data(), testfn_names_c_str.data(), false, false, 0);
} }

View File

@@ -26,11 +26,6 @@ cl_device_type gDeviceType = CL_DEVICE_TYPE_DEFAULT;
int main(int argc, const char *argv[]) int main(int argc, const char *argv[])
{ {
// Get list to all test functions auto& tests = autotest::test_suite::global_test_suite().test_defs;
std::vector<basefn> testfn_list = autotest::test_suite::get_test_functions(); return runTestHarness(argc, argv, tests.size(), tests.data(), false, false, 0);
// Get names of all test functions
std::vector<std::string> testfn_names = autotest::test_suite::get_test_names();
// Create a vector of pointers to the names test functions
std::vector<const char *> testfn_names_c_str = autotest::get_strings_ptrs(testfn_names);
return runTestHarness(argc, argv, testfn_list.size(), testfn_list.data(), testfn_names_c_str.data(), false, false, 0);
} }

View File

@@ -21,11 +21,6 @@
int main(int argc, const char *argv[]) int main(int argc, const char *argv[])
{ {
// Get list to all test functions auto& tests = autotest::test_suite::global_test_suite().test_defs;
std::vector<basefn> testfn_list = autotest::test_suite::get_test_functions(); return runTestHarness(argc, argv, tests.size(), tests.data(), false, false, 0);
// Get names of all test functions
std::vector<std::string> testfn_names = autotest::test_suite::get_test_names();
// Create a vector of pointers to the names test functions
std::vector<const char *> testfn_names_c_str = autotest::get_strings_ptrs(testfn_names);
return runTestHarness(argc, argv, testfn_list.size(), testfn_list.data(), testfn_names_c_str.data(), false, false, 0);
} }

View File

@@ -45,11 +45,6 @@ int main(int argc, const char *argv[])
); );
} }
// Get list to all test functions auto& tests = autotest::test_suite::global_test_suite().test_defs;
std::vector<basefn> testfn_list = autotest::test_suite::get_test_functions(); return runTestHarness(argc, argv, tests.size(), tests.data(), false, false, 0);
// Get names of all test functions
std::vector<std::string> testfn_names = autotest::test_suite::get_test_names();
// Create a vector of pointers to the names test functions
std::vector<const char *> testfn_names_c_str = autotest::get_strings_ptrs(testfn_names);
return runTestHarness(argc, argv, testfn_list.size(), testfn_list.data(), testfn_names_c_str.data(), false, false, 0);
} }

View File

@@ -20,11 +20,6 @@
int main(int argc, const char *argv[]) int main(int argc, const char *argv[])
{ {
// Get list to all test functions auto& tests = autotest::test_suite::global_test_suite().test_defs;
std::vector<basefn> testfn_list = autotest::test_suite::get_test_functions(); return runTestHarness(argc, argv, tests.size(), tests.data(), false, false, 0);
// Get names of all test functions
std::vector<std::string> testfn_names = autotest::test_suite::get_test_names();
// Create a vector of pointers to the names test functions
std::vector<const char *> testfn_names_c_str = autotest::get_strings_ptrs(testfn_names);
return runTestHarness(argc, argv, testfn_list.size(), testfn_list.data(), testfn_names_c_str.data(), false, false, 0);
} }

View File

@@ -19,11 +19,6 @@
int main(int argc, const char *argv[]) int main(int argc, const char *argv[])
{ {
// Get list to all test functions auto& tests = autotest::test_suite::global_test_suite().test_defs;
std::vector<basefn> testfn_list = autotest::test_suite::get_test_functions(); return runTestHarness(argc, argv, tests.size(), tests.data(), false, false, 0);
// Get names of all test functions
std::vector<std::string> testfn_names = autotest::test_suite::get_test_names();
// Create a vector of pointers to the names test functions
std::vector<const char *> testfn_names_c_str = autotest::get_strings_ptrs(testfn_names);
return runTestHarness(argc, argv, testfn_list.size(), testfn_list.data(), testfn_names_c_str.data(), false, false, 0);
} }

View File

@@ -20,11 +20,6 @@
int main(int argc, const char *argv[]) int main(int argc, const char *argv[])
{ {
// Get list to all test functions auto& tests = autotest::test_suite::global_test_suite().test_defs;
std::vector<basefn> testfn_list = autotest::test_suite::get_test_functions(); return runTestHarness(argc, argv, tests.size(), tests.data(), false, false, 0);
// Get names of all test functions
std::vector<std::string> testfn_names = autotest::test_suite::get_test_names();
// Create a vector of pointers to the names test functions
std::vector<const char *> testfn_names_c_str = autotest::get_strings_ptrs(testfn_names);
return runTestHarness(argc, argv, testfn_list.size(), testfn_list.data(), testfn_names_c_str.data(), false, false, 0);
} }

View File

@@ -21,11 +21,6 @@
int main(int argc, const char *argv[]) int main(int argc, const char *argv[])
{ {
// Get list to all test functions auto& tests = autotest::test_suite::global_test_suite().test_defs;
std::vector<basefn> testfn_list = autotest::test_suite::get_test_functions(); return runTestHarness(argc, argv, tests.size(), tests.data(), false, false, 0);
// Get names of all test functions
std::vector<std::string> testfn_names = autotest::test_suite::get_test_names();
// Create a vector of pointers to the names test functions
std::vector<const char *> testfn_names_c_str = autotest::get_strings_ptrs(testfn_names);
return runTestHarness(argc, argv, testfn_list.size(), testfn_list.data(), testfn_names_c_str.data(), false, false, 0);
} }

View File

@@ -21,11 +21,6 @@
int main(int argc, const char *argv[]) int main(int argc, const char *argv[])
{ {
// Get list to all test functions auto& tests = autotest::test_suite::global_test_suite().test_defs;
std::vector<basefn> testfn_list = autotest::test_suite::get_test_functions(); return runTestHarness(argc, argv, tests.size(), tests.data(), false, false, 0);
// Get names of all test functions
std::vector<std::string> testfn_names = autotest::test_suite::get_test_names();
// Create a vector of pointers to the names test functions
std::vector<const char *> testfn_names_c_str = autotest::get_strings_ptrs(testfn_names);
return runTestHarness(argc, argv, testfn_list.size(), testfn_list.data(), testfn_names_c_str.data(), false, false, 0);
} }

View File

@@ -24,11 +24,6 @@
int main(int argc, const char *argv[]) int main(int argc, const char *argv[])
{ {
// Get list to all test functions auto& tests = autotest::test_suite::global_test_suite().test_defs;
std::vector<basefn> testfn_list = autotest::test_suite::get_test_functions(); return runTestHarness(argc, argv, tests.size(), tests.data(), false, false, 0);
// Get names of all test functions
std::vector<std::string> testfn_names = autotest::test_suite::get_test_names();
// Create a vector of pointers to the names test functions
std::vector<const char *> testfn_names_c_str = autotest::get_strings_ptrs(testfn_names);
return runTestHarness(argc, argv, testfn_list.size(), testfn_list.data(), testfn_names_c_str.data(), false, false, 0);
} }

View File

@@ -22,11 +22,6 @@
int main(int argc, const char *argv[]) int main(int argc, const char *argv[])
{ {
// Get list to all test functions auto& tests = autotest::test_suite::global_test_suite().test_defs;
std::vector<basefn> testfn_list = autotest::test_suite::get_test_functions(); return runTestHarness(argc, argv, tests.size(), tests.data(), false, false, 0);
// Get names of all test functions
std::vector<std::string> testfn_names = autotest::test_suite::get_test_names();
// Create a vector of pointers to the names test functions
std::vector<const char *> testfn_names_c_str = autotest::get_strings_ptrs(testfn_names);
return runTestHarness(argc, argv, testfn_list.size(), testfn_list.data(), testfn_names_c_str.data(), false, false, 0);
} }

View File

@@ -20,11 +20,6 @@
int main(int argc, const char *argv[]) int main(int argc, const char *argv[])
{ {
// Get list to all test functions auto& tests = autotest::test_suite::global_test_suite().test_defs;
std::vector<basefn> testfn_list = autotest::test_suite::get_test_functions(); return runTestHarness(argc, argv, tests.size(), tests.data(), false, false, 0);
// Get names of all test functions
std::vector<std::string> testfn_names = autotest::test_suite::get_test_names();
// Create a vector of pointers to the names test functions
std::vector<const char *> testfn_names_c_str = autotest::get_strings_ptrs(testfn_names);
return runTestHarness(argc, argv, testfn_list.size(), testfn_list.data(), testfn_names_c_str.data(), false, false, 0);
} }

View File

@@ -24,11 +24,6 @@
int main(int argc, const char *argv[]) int main(int argc, const char *argv[])
{ {
// Get list to all test functions auto& tests = autotest::test_suite::global_test_suite().test_defs;
std::vector<basefn> testfn_list = autotest::test_suite::get_test_functions(); return runTestHarness(argc, argv, tests.size(), tests.data(), false, false, 0);
// Get names of all test functions
std::vector<std::string> testfn_names = autotest::test_suite::get_test_names();
// Create a vector of pointers to the names test functions
std::vector<const char *> testfn_names_c_str = autotest::get_strings_ptrs(testfn_names);
return runTestHarness(argc, argv, testfn_list.size(), testfn_list.data(), testfn_names_c_str.data(), false, false, 0);
} }

View File

@@ -20,11 +20,6 @@
int main(int argc, const char *argv[]) int main(int argc, const char *argv[])
{ {
// Get list to all test functions auto& tests = autotest::test_suite::global_test_suite().test_defs;
std::vector<basefn> testfn_list = autotest::test_suite::get_test_functions(); return runTestHarness(argc, argv, tests.size(), tests.data(), false, false, 0);
// Get names of all test functions
std::vector<std::string> testfn_names = autotest::test_suite::get_test_names();
// Create a vector of pointers to the names test functions
std::vector<const char *> testfn_names_c_str = autotest::get_strings_ptrs(testfn_names);
return runTestHarness(argc, argv, testfn_list.size(), testfn_list.data(), testfn_names_c_str.data(), false, false, 0);
} }

View File

@@ -25,63 +25,39 @@ int g_arrStrangeVectorSizes[kStrangeVectorSizeCount] = {3};
static void initVecSizes() { static void initVecSizes() {
int i; int i;
for(i = 0; i < kVectorSizeCount; ++i) { for(i = 0; i < kVectorSizeCount; ++i) {
g_arrVecSizes[i] = (1<<i); g_arrVecSizes[i] = (1<<i);
} }
for(; i < kVectorSizeCount + kStrangeVectorSizeCount; ++i) { for(; i < kVectorSizeCount + kStrangeVectorSizeCount; ++i) {
g_arrVecSizes[i] = g_arrStrangeVectorSizes[i-kVectorSizeCount]; g_arrVecSizes[i] = g_arrStrangeVectorSizes[i-kVectorSizeCount];
} }
} }
basefn commonfn_list[] = { test_definition test_list[] = {
test_clamp, ADD_TEST( clamp ),
test_degrees, ADD_TEST( degrees ),
test_fmax, ADD_TEST( fmax ),
test_fmaxf, ADD_TEST( fmaxf ),
test_fmin, ADD_TEST( fmin ),
test_fminf, ADD_TEST( fminf ),
test_max, ADD_TEST( max ),
test_maxf, ADD_TEST( maxf ),
test_min, ADD_TEST( min ),
test_minf, ADD_TEST( minf ),
test_mix, ADD_TEST( mix ),
test_radians, ADD_TEST( radians ),
test_step, ADD_TEST( step ),
test_stepf, ADD_TEST( stepf ),
test_smoothstep, ADD_TEST( smoothstep ),
test_smoothstepf, ADD_TEST( smoothstepf ),
test_sign, ADD_TEST( sign ),
}; };
const char *commonfn_names[] = { const int test_num = ARRAY_SIZE( test_list );
"clamp",
"degrees",
"fmax",
"fmaxf",
"fmin",
"fminf",
"max",
"maxf",
"min",
"minf",
"mix",
"radians",
"step",
"stepf",
"smoothstep",
"smoothstepf",
"sign",
};
ct_assert((sizeof(commonfn_names) / sizeof(commonfn_names[0])) == (sizeof(commonfn_list) / sizeof(commonfn_list[0]))); int main(int argc, const char *argv[])
int num_commonfns = sizeof(commonfn_names) / sizeof(char *);
int
main(int argc, const char *argv[])
{ {
initVecSizes(); 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 #define DEFAULT_NUM_ELEMENTS 0x4000
int runTestHarness( int argc, const char *argv[], unsigned int num_fns, int runTestHarness( int argc, const char *argv[], int testNum, test_definition testList[],
basefn fnList[], const char *fnNames[], int imageSupportRequired, int forceNoContextCreation, cl_command_queue_properties queueProps )
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 ); ( imageSupportRequired ) ? verifyImageSupport : NULL );
} }
int runTestHarnessWithCheck( int argc, const char *argv[], unsigned int num_fns, int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_definition testList[],
basefn fnList[], const char *fnNames[], int imageSupportRequired, int forceNoContextCreation, cl_command_queue_properties queueProps,
int imageSupportRequired, int forceNoContextCreation, cl_command_queue_properties queueProps, DeviceCheckFn deviceCheckFn )
DeviceCheckFn deviceCheckFn )
{ {
test_start(); test_start();
log_info("*** Compatibility with Previous Versions test ***\n"); 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_uint num_platforms = 0;
cl_platform_id *platforms; cl_platform_id *platforms;
cl_device_id device; cl_device_id device;
@@ -80,7 +78,6 @@ int runTestHarnessWithCheck( int argc, const char *argv[], unsigned int num_fns,
int err, ret; int err, ret;
char *endPtr; char *endPtr;
unsigned int i;
int based_on_env_var = 0; 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 */ /* Special case: just list the tests */
if( ( argc > 1 ) && (!strcmp( argv[ 1 ], "-list" ) || !strcmp( argv[ 1 ], "-h" ) || !strcmp( argv[ 1 ], "--help" ))) 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( "\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( "\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( "\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" ); 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(); test_finish();
return 0; return 0;
@@ -468,7 +465,7 @@ int runTestHarnessWithCheck( int argc, const char *argv[], unsigned int num_fns,
DisableFTZ( &oldMode ); DisableFTZ( &oldMode );
#endif #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__) #if defined(__APPLE__) && defined(__arm__)
// Restore the old FP mode before leaving. // Restore the old FP mode before leaving.
@@ -478,23 +475,23 @@ int runTestHarnessWithCheck( int argc, const char *argv[], unsigned int num_fns,
return error; 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 ) const char *wildcard )
{ {
int found_tests = 0; int found_tests = 0;
size_t wildcard_length = strlen( wildcard ) - 1; /* -1 for the asterisk */ 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; return EXIT_FAILURE;
} }
fnsToCall[ fnIndex ] = 1; selectedTestList[ fnIndex ] = 1;
found_tests = 1; found_tests = 1;
} }
} }
@@ -508,29 +505,29 @@ static int find_wildcard_matching_functions( const char *fnNames[], unsigned cha
return EXIT_SUCCESS; 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 ) 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; return EXIT_FAILURE;
} }
else else
{ {
fnsToCall[ fnIndex ] = 1; selectedTestList[ fnIndex ] = 1;
break; break;
} }
} }
} }
if( fnIndex == num_fns ) if( fnIndex == testNum )
{ {
log_error( "ERROR: The argument '%s' did not match any test names.\n", argument ); log_error( "ERROR: The argument '%s' did not match any test names.\n", argument );
return EXIT_FAILURE; return EXIT_FAILURE;
@@ -539,18 +536,18 @@ static int find_argument_matching_function( const char *fnNames[], unsigned char
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
int parseAndCallCommandLineTests( int argc, const char *argv[], cl_device_id device, unsigned int num_fns, int parseAndCallCommandLineTests( int argc, const char *argv[], cl_device_id device, int testNum,
basefn fnList[], const char *fnNames[], int forceNoContextCreation, test_definition testList[], int forceNoContextCreation,
cl_command_queue_properties queueProps, int num_elements ) cl_command_queue_properties queueProps, int num_elements )
{ {
int ret = EXIT_SUCCESS; int ret = EXIT_SUCCESS;
unsigned char *fnsToCall = ( unsigned char* ) calloc( num_fns, 1 ); unsigned char *selectedTestList = ( unsigned char* ) calloc( testNum, 1 );
if( argc == 1 ) if( argc == 1 )
{ {
/* No actual arguments, all tests will be run. */ /* No actual arguments, all tests will be run. */
memset( fnsToCall, 1, num_fns ); memset( selectedTestList, 1, testNum );
} }
else else
{ {
@@ -558,18 +555,18 @@ int parseAndCallCommandLineTests( int argc, const char *argv[], cl_device_id dev
{ {
if( strchr( argv[ argIndex ], '*' ) != NULL ) 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 else
{ {
if( strcmp( argv[ argIndex ], "all" ) == 0 ) if( strcmp( argv[ argIndex ], "all" ) == 0 )
{ {
memset( fnsToCall, 1, num_fns ); memset( selectedTestList, 1, testNum );
break; break;
} }
else 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 ) 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 ) if( gTestsFailed == 0 )
{ {
@@ -610,30 +607,30 @@ int parseAndCallCommandLineTests( int argc, const char *argv[], cl_device_id dev
test_finish(); test_finish();
free( fnsToCall ); free( selectedTestList );
return ret; return ret;
} }
int callTestFunctions( basefn functionList[], const char *functionNames[], unsigned char functionsToCall[], int callTestFunctions( test_definition testList[], unsigned char selectedTestList[],
int numFunctions, cl_device_id deviceToUse, int forceNoContextCreation, int testNum, cl_device_id deviceToUse, int forceNoContextCreation,
int numElementsToUse, cl_command_queue_properties queueProps ) int numElementsToUse, cl_command_queue_properties queueProps )
{ {
int numErrors = 0; 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. */ /* Skip any unimplemented tests. */
if( functionList[ i ] != NULL ) if( testList[i].func != NULL )
{ {
numErrors += callSingleTestFunction( functionList[ i ], functionNames[ i ], deviceToUse, numErrors += callSingleTestFunction( testList[i], deviceToUse, forceNoContextCreation,
forceNoContextCreation, numElementsToUse, queueProps ); numElementsToUse, queueProps );
} }
else 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 // Actual function execution
int callSingleTestFunction( basefn functionToCall, const char *functionName, int callSingleTestFunction( test_definition test, cl_device_id deviceToUse, int forceNoContextCreation,
cl_device_id deviceToUse, int forceNoContextCreation, int numElementsToUse, cl_command_queue_properties queueProps )
int numElementsToUse, cl_command_queue_properties queueProps )
{ {
int numErrors = 0, ret; int numErrors = 0, ret;
cl_int error; cl_int error;
@@ -675,26 +671,26 @@ int callSingleTestFunction( basefn functionToCall, const char *functionName,
} }
/* Run the test and print the result */ /* Run the test and print the result */
log_info( "%s...\n", functionName ); log_info( "%s...\n", test.name );
fflush( stdout ); 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 ) if( ret == TEST_NOT_IMPLEMENTED )
{ {
/* Tests can also let us know they're not implemented yet */ /* 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 else
{ {
/* Print result */ /* Print result */
if( ret == 0 ) { if( ret == 0 ) {
log_info( "%s passed\n", functionName ); log_info( "%s passed\n", test.name );
gTestsPassed++; gTestsPassed++;
} }
else else
{ {
numErrors++; numErrors++;
log_error( "%s FAILED\n", functionName ); log_error( "%s FAILED\n", test.name );
gTestsFailed++; gTestsFailed++;
} }
} }

View File

@@ -23,6 +23,17 @@
extern "C" { extern "C" {
#endif #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 typedef enum test_status
{ {
TEST_PASS = 0, 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 // 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. // 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, extern int runTestHarness(int argc, const char *argv[], int testNum, test_definition testList[],
basefn fnList[], const char *fnNames[], int imageSupportRequired, int forceNoContextCreation, cl_command_queue_properties queueProps );
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. // 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 ); typedef test_status (*DeviceCheckFn)( cl_device_id device );
// Same as runTestHarness, but also supplies a function that checks the created device for required functionality. // 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, extern int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_definition testList[],
basefn fnList[], const char *fnNames[], int imageSupportRequired, int forceNoContextCreation, cl_command_queue_properties queueProps,
int imageSupportRequired, int forceNoContextCreation, cl_command_queue_properties queueProps, DeviceCheckFn deviceCheckFn ); DeviceCheckFn deviceCheckFn );
// The command line parser used by runTestHarness to break up parameters into calls to callTestFunctions // 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, extern int parseAndCallCommandLineTests( int argc, const char *argv[], cl_device_id device, int testNum,
basefn *fnList, const char *fnNames[], test_definition testList[], int forceNoContextCreation,
int forceNoContextCreation, cl_command_queue_properties queueProps, int num_elements ); 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/ // Call this function if you need to do all the setup work yourself, and just need the function list called/
// managed. // managed.
// functionList is the actual array of functions // testList is the data structure that contains test functions and its names
// functionNames is an array of strings representing the name of each function // selectedTestList is an array of integers (treated as bools) which tell which function is to be called,
// 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 testList at index i
// each element at index i, corresponds to the element in functionList at index i // testNum is the number of tests in testList and selectedTestList
// numFunctions is the number of elements in the arrays
// contextProps are used to create a testing context for each test // contextProps are used to create a testing context for each test
// deviceToUse and numElementsToUse are all just passed to each test function // deviceToUse and numElementsToUse are all just passed to each test function
extern int callTestFunctions( basefn functionList[], const char *functionNames[], unsigned char functionsToCall[], extern int callTestFunctions( test_definition testList[], unsigned char selectedTestList[],
int numFunctions, cl_device_id deviceToUse, int forceNoContextCreation, int testNum, cl_device_id deviceToUse, int forceNoContextCreation,
int numElementsToUse, cl_command_queue_properties queueProps ); int numElementsToUse, cl_command_queue_properties queueProps );
// This function is called by callTestFunctions, once per function, to do setup, call, logging and cleanup // This function is called by callTestFunctions, once per function, to do setup, call, logging and cleanup
extern int callSingleTestFunction( basefn functionToCall, const char *functionName, extern int callSingleTestFunction( test_definition test, cl_device_id deviceToUse, int forceNoContextCreation,
cl_device_id deviceToUse, int forceNoContextCreation,
int numElementsToUse, cl_command_queue_properties queueProps ); int numElementsToUse, cl_command_queue_properties queueProps );
///// Miscellaneous steps ///// Miscellaneous steps

View File

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

View File

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

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(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_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_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_mri_one(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_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_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_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); 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_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_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); 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" " result[1] = %s(ul);\n"
"}\n"; "}\n";
int int test_parameter_types_long(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
test_basic_parameter_types_long(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
{ {
clMemWrapper results; clMemWrapper results;
int error; int error;
@@ -157,10 +156,9 @@ test_basic_parameter_types_long(cl_device_id device, cl_context context, cl_comm
return total_errors; return total_errors;
} }
int int test_parameter_types(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
test_basic_parameter_types(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
{ {
clMemWrapper results; clMemWrapper results;
int error; int error;
size_t global[3] = {1, 1, 1}; size_t global[3] = {1, 1, 1};
float results_back[7*16]; 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) { if (gHasLong) {
log_info("Testing long types...\n"); 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 { else {
log_info("Longs unsupported, skipping."); log_info("Longs unsupported, skipping.");

View File

@@ -110,7 +110,7 @@ verify_multireadimage(void *image[], float *outptr, int w, int h)
int 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_mem streams[4];
cl_image_format img_format; 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_mem streams[8];
cl_image_format img_format; cl_image_format img_format;

View File

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

View File

@@ -718,22 +718,11 @@ int getConfigInfos( cl_device_id device )
} }
int main(int argc, const char** argv) int test_computeinfo( cl_device_id deviceID, cl_context context, cl_command_queue ignoreQueue, int num_elements )
{ {
cl_platform_id platform;
test_start();
if (argc == 2) {
if (!strcmp(argv[1], "-v"))
dump_supported_formats = 1;
else {
log_info("Use option \"-v\" for verbose output\n");
return 0;
}
}
int err; int err;
int total_errors = 0; int total_errors = 0;
cl_platform_id platform;
err = clGetPlatformIDs(1, &platform, NULL); err = clGetPlatformIDs(1, &platform, NULL);
test_error(err, "clGetPlatformIDs failed"); test_error(err, "clGetPlatformIDs failed");
@@ -864,14 +853,40 @@ int main(int argc, const char** argv)
} }
} }
if (total_errors) return total_errors;
log_error("FAILED computeinfo.\n"); }
else
log_info("PASSED computeinfo.\n"); test_definition test_list[] = {
ADD_TEST( computeinfo ),
test_finish(); };
if (total_errors)
return -1; const int test_num = ARRAY_SIZE( test_list );
return 0;
int main(int argc, const char** argv)
{
const char** argList = (const char**)calloc( argc, sizeof(char*) );
if( NULL == argList )
{
log_error( "Failed to allocate memory for argList array.\n" );
return 1;
}
argList[0] = argv[0];
size_t argCount = 1;
for( int i = 1; i < argc; i++ )
{
if( strcmp(argv[1], "-v") == 0)
{
dump_supported_formats = 1;
}
else
{
argList[argCount] = argv[i];
argCount++;
}
}
return runTestHarness( argCount, argList, test_num, test_list, false, true, 0 );
} }

View File

@@ -301,47 +301,26 @@ int test_contractions_double_7(cl_device_id deviceID, cl_context context, cl_com
return RunTest_Double(7); return RunTest_Double(7);
} }
basefn basefn_list[] = { test_definition test_list[] = {
test_contractions_float_0, ADD_TEST( contractions_float_0 ),
test_contractions_float_1, ADD_TEST( contractions_float_1 ),
test_contractions_float_2, ADD_TEST( contractions_float_2 ),
test_contractions_float_3, ADD_TEST( contractions_float_3 ),
test_contractions_float_4, ADD_TEST( contractions_float_4 ),
test_contractions_float_5, ADD_TEST( contractions_float_5 ),
test_contractions_float_6, ADD_TEST( contractions_float_6 ),
test_contractions_float_7, ADD_TEST( contractions_float_7 ),
test_contractions_double_0, ADD_TEST( contractions_double_0 ),
test_contractions_double_1, ADD_TEST( contractions_double_1 ),
test_contractions_double_2, ADD_TEST( contractions_double_2 ),
test_contractions_double_3, ADD_TEST( contractions_double_3 ),
test_contractions_double_4, ADD_TEST( contractions_double_4 ),
test_contractions_double_5, ADD_TEST( contractions_double_5 ),
test_contractions_double_6, ADD_TEST( contractions_double_6 ),
test_contractions_double_7, ADD_TEST( contractions_double_7 ),
}; };
const char *basefn_names[] = { const int test_num = ARRAY_SIZE( test_list );
"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 *);
int main( int argc, const char **argv ) int main( int argc, const char **argv )
{ {
@@ -362,7 +341,7 @@ int main( int argc, const char **argv )
if( error ) if( error )
goto exit; 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: exit:
if( gQueue ) if( gQueue )
@@ -571,9 +550,9 @@ static void PrintUsage( void )
vlog( "\t\t-sNUMBER set random seed.\n"); vlog( "\t\t-sNUMBER set random seed.\n");
vlog( "\n" ); vlog( "\n" );
vlog( "\tTest names:\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; return gFailCount;
} }
basefn basefn_list[] = { test_definition test_list[] = {
test_conversions, ADD_TEST( conversions ),
}; };
const char *basefn_names[] = { const int test_num = ARRAY_SIZE( test_list );
"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 *);
#pragma mark - #pragma mark -
@@ -333,7 +327,7 @@ int main (int argc, const char **argv )
vlog( "Random seed: %u\n", seed ); vlog( "Random seed: %u\n", seed );
gMTdata = init_genrand( 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 ); free_mtdata( gMTdata );

View File

@@ -28,46 +28,25 @@
std::string gKernelName; std::string gKernelName;
int gWimpyMode = 0; int gWimpyMode = 0;
basefn basefn_list[] = test_definition test_list[] = {
{
#ifdef CL_VERSION_2_0 #ifdef CL_VERSION_2_0
test_device_info, ADD_TEST( device_info ),
test_device_queue, ADD_TEST( device_queue ),
test_execute_block, ADD_TEST( execute_block ),
test_enqueue_block, ADD_TEST( enqueue_block ),
test_enqueue_nested_blocks, ADD_TEST( enqueue_nested_blocks ),
test_enqueue_wg_size, ADD_TEST( enqueue_wg_size ),
test_enqueue_flags, ADD_TEST( enqueue_flags ),
test_enqueue_multi_queue, ADD_TEST( enqueue_multi_queue ),
test_host_multi_queue, ADD_TEST( host_multi_queue ),
test_enqueue_ndrange, ADD_TEST( enqueue_ndrange ),
test_host_queue_order, ADD_TEST( host_queue_order ),
#endif #endif
}; };
const char *commonfn_names[] = const int test_num = ARRAY_SIZE( 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",
#endif
};
ct_assert(arr_size(commonfn_names) == arr_size(basefn_list)) int main(int argc, const char *argv[])
static const int num_commonfns = arr_size(commonfn_names);
int
main(int argc, const char *argv[])
{ {
argc = parseCustomParam(argc, argv); argc = parseCustomParam(argc, argv);
@@ -97,5 +76,5 @@ main(int argc, const char *argv[])
} }
} }
return runTestHarness(argc, argv, num_commonfns, basefn_list, commonfn_names, false, false, 0); return runTestHarnessWithCheck(argc, argv, test_num, test_list, false, false, 0, NULL);
} }

View File

@@ -25,36 +25,21 @@
#include <unistd.h> #include <unistd.h>
#endif #endif
basefn basefn_list[] = { test_definition test_list[] = {
test_partition_equally, ADD_TEST( partition_equally ),
test_partition_by_counts, ADD_TEST( partition_by_counts ),
test_partition_by_affinity_domain_numa, ADD_TEST( partition_by_affinity_domain_numa ),
test_partition_by_affinity_domain_l4_cache, ADD_TEST( partition_by_affinity_domain_l4_cache ),
test_partition_by_affinity_domain_l3_cache, ADD_TEST( partition_by_affinity_domain_l3_cache ),
test_partition_by_affinity_domain_l2_cache, ADD_TEST( partition_by_affinity_domain_l2_cache ),
test_partition_by_affinity_domain_l1_cache, ADD_TEST( partition_by_affinity_domain_l1_cache ),
test_partition_by_affinity_domain_next_partitionable, ADD_TEST( partition_by_affinity_domain_next_partitionable ),
test_partition ADD_TEST( partition_all ),
}; };
const int test_num = ARRAY_SIZE( test_list );
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 *);
int main(int argc, const char *argv[]) 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/typeWrappers.h"
#include "../../test_common/harness/mt19937.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_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_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); 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); 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); return test_partition_of_device(deviceID, context, queue, num_elements, NULL, 0, 8);
} }

View File

@@ -25,20 +25,15 @@
#include "procs.h" #include "procs.h"
basefn basefn_list[] = { test_definition test_list[] = {
test_timer_resolution_queries, ADD_TEST( timer_resolution_queries ),
test_device_and_host_timers ADD_TEST( device_and_host_timers ),
}; };
const char *basefn_names[] = { const int test_num = ARRAY_SIZE( test_list );
"test_timer_resolution_queries",
"test_device_and_host_timers"
};
size_t num_fns = sizeof(basefn_names)/sizeof(basefn_names[0]);
int main(int argc, const char *argv[]) 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

@@ -23,86 +23,45 @@
#include <unistd.h> #include <unistd.h>
#endif #endif
basefn basefn_list[] = { test_definition test_list[] = {
test_event_get_execute_status, ADD_TEST( event_get_execute_status ),
test_event_get_write_array_status, ADD_TEST( event_get_write_array_status ),
test_event_get_read_array_status, ADD_TEST( event_get_read_array_status ),
test_event_get_info, ADD_TEST( event_get_info ),
test_event_wait_for_execute, ADD_TEST( event_wait_for_execute ),
test_event_wait_for_array, ADD_TEST( event_wait_for_array ),
test_event_flush, ADD_TEST( event_flush ),
test_event_finish_execute, ADD_TEST( event_finish_execute ),
test_event_finish_array, ADD_TEST( event_finish_array ),
test_event_release_before_done, ADD_TEST( event_release_before_done ),
test_event_enqueue_marker, ADD_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",
#ifdef CL_VERSION_1_2 #ifdef CL_VERSION_1_2
"event_enqueue_marker_with_event_list", ADD_TEST( event_enqueue_marker_with_event_list ),
"event_enqueue_barrier_with_event_list", ADD_TEST( event_enqueue_barrier_with_event_list ),
#endif #endif
"out_of_order_event_waitlist_single_queue", ADD_TEST( out_of_order_event_waitlist_single_queue ),
"out_of_order_event_waitlist_multi_queue", ADD_TEST( out_of_order_event_waitlist_multi_queue ),
"out_of_order_event_waitlist_multi_queue_multi_device", ADD_TEST( out_of_order_event_waitlist_multi_queue_multi_device ),
"out_of_order_event_enqueue_wait_for_events_single_queue", ADD_TEST( out_of_order_event_enqueue_wait_for_events_single_queue ),
"out_of_order_event_enqueue_wait_for_events_multi_queue", ADD_TEST( out_of_order_event_enqueue_wait_for_events_multi_queue ),
"out_of_order_event_enqueue_wait_for_events_multi_queue_multi_device", ADD_TEST( out_of_order_event_enqueue_wait_for_events_multi_queue_multi_device ),
"out_of_order_event_enqueue_marker_single_queue", ADD_TEST( out_of_order_event_enqueue_marker_single_queue ),
"out_of_order_event_enqueue_marker_multi_queue", ADD_TEST( out_of_order_event_enqueue_marker_multi_queue ),
"out_of_order_event_enqueue_marker_multi_queue_multi_device", ADD_TEST( out_of_order_event_enqueue_marker_multi_queue_multi_device ),
"out_of_order_event_enqueue_barrier_single_queue", ADD_TEST( out_of_order_event_enqueue_barrier_single_queue ),
"waitlists", ADD_TEST( waitlists ),
"test_userevents", ADD_TEST( userevents ),
ADD_TEST( callbacks ),
"callbacks", ADD_TEST( callbacks_simultaneous ),
"callbacks_simultaneous", ADD_TEST( userevents_multithreaded ),
"userevents_multithreaded",
}; };
ct_assert((sizeof(basefn_names) / sizeof(basefn_names[0])) == (sizeof(basefn_list) / sizeof(basefn_list[0]))); const int test_num = ARRAY_SIZE( test_list );
int num_fns = sizeof(basefn_names) / sizeof(char *);
int main(int argc, const char *argv[]) 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_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); 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 #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_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_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 #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_out_of_order_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_out_of_order_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_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_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_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( 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_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_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_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( 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_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_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 ); 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_queues = 0;
int two_devices = 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); 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_queues = 1;
int two_devices = 0; 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); 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_queues = 1;
int two_devices = 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_queues = 0;
int two_devices = 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); 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_queues = 1;
int two_devices = 0; 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_queues = 1;
int two_devices = 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_queues = 0;
int two_devices = 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_queues = 0;
int two_devices = 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); 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_queues = 1;
int two_devices = 0; 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_queues = 1;
int two_devices = 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 #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; cl_int status;
@@ -634,10 +634,8 @@ int test_event_enqueue_marker_with_list( cl_device_id deviceID, cl_context conte
FINISH_EVENT(queue); FINISH_EVENT(queue);
return 0; return 0;
} }
#endif
#ifdef CL_VERSION_1_2 int test_event_enqueue_barrier_with_event_list( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
int test_event_enqueue_barrier_with_list( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{ {
cl_int status; cl_int status;

View File

@@ -92,7 +92,7 @@ private:
const std::vector<std::string> _kernels; 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 + const std::string KERNEL_FUNCTION = common::CONFORMANCE_VERIFY_FENCE +
NL NL
NL "__global int gint = 1;" 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); 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 = const std::string KERNEL_FUNCTION =
NL NL
NL "__global int gint = 1;" NL "__global int gint = 1;"

View File

@@ -18,8 +18,8 @@
#include <iostream> #include <iostream>
// basic tests // 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_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_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_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_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); 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_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); 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 // basic tests
test_function_params_get_fence, ADD_TEST( function_get_fence ),
test_function_params_to_address_space, ADD_TEST( function_to_address_space ),
test_variable_get_fence, ADD_TEST( variable_get_fence ),
test_variable_to_address_space, ADD_TEST( variable_to_address_space ),
test_casting, ADD_TEST( casting ),
test_conditional_casting, ADD_TEST( conditional_casting ),
test_chain_casting, ADD_TEST( chain_casting ),
test_ternary_operator_casting, ADD_TEST( ternary_operator_casting ),
test_language_struct, ADD_TEST( language_struct ),
test_language_union, ADD_TEST( language_union ),
test_multiple_calls_same_function, ADD_TEST( multiple_calls_same_function ),
test_compare_pointers, ADD_TEST( compare_pointers ),
// advanced tests // advanced tests
test_library_function, ADD_TEST( library_function ),
test_generic_variable_volatile, ADD_TEST( generic_variable_volatile ),
test_generic_variable_const, ADD_TEST( generic_variable_const ),
test_generic_variable_gentype, ADD_TEST( generic_variable_gentype ),
test_builtin_functions, ADD_TEST( builtin_functions ),
test_generic_advanced_casting, ADD_TEST( generic_advanced_casting ),
test_generic_ptr_to_host_mem, ADD_TEST( generic_ptr_to_host_mem ),
test_max_number_of_params, ADD_TEST( max_number_of_params ),
}; };
const char *basefn_names[] = { const int test_num = ARRAY_SIZE( test_list );
//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 *);
/* /*
Generic Address Space Generic Address Space
@@ -102,5 +75,5 @@ int num_fns = sizeof(basefn_names) / sizeof(char *);
int main(int argc, const char *argv[]) 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> #include <unistd.h>
#endif #endif
basefn basefn_list[] = { test_definition test_list[] = {
test_geom_cross, ADD_TEST( geom_cross ),
test_geom_dot, ADD_TEST( geom_dot ),
test_geom_distance, ADD_TEST( geom_distance ),
test_geom_fast_distance, ADD_TEST( geom_fast_distance ),
test_geom_length, ADD_TEST( geom_length ),
test_geom_fast_length, ADD_TEST( geom_fast_length ),
test_geom_normalize, ADD_TEST( geom_normalize ),
test_geom_fast_normalize ADD_TEST( geom_fast_normalize ),
}; };
const int test_num = ARRAY_SIZE( test_list );
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};
int main(int argc, const char *argv[]) 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/threadTesting.h"
#include "../../test_common/harness/typeWrappers.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 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); extern int test_geom_cross(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);

View File

@@ -34,177 +34,108 @@
static cl_context sCurrentContext = NULL; 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 ) \ #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; \ int error; \
clCommandQueueWrapper realQueue = clCreateCommandQueueWithProperties( sCurrentContext, device, 0, &error ); \ clCommandQueueWrapper realQueue = clCreateCommandQueueWithProperties( sCurrentContext, device, 0, &error ); \
test_error( error, "Unable to create command queue" ); \ test_error( error, "Unable to create command queue" ); \
return fn( device, sCurrentContext, realQueue, numElements ); \ return test_##fn( device, sCurrentContext, realQueue, numElements ); \
} }
// buffers: // buffers:
TEST_FN_REDIRECTOR( test_buffers ) TEST_FN_REDIRECTOR( buffers )
TEST_FN_REDIRECTOR( test_buffers_getinfo ) TEST_FN_REDIRECTOR( buffers_getinfo )
// 1D images: // 1D images:
TEST_FN_REDIRECTOR( test_images_read_1D ) TEST_FN_REDIRECTOR( images_read_1D )
TEST_FN_REDIRECTOR( test_images_write_1D ) TEST_FN_REDIRECTOR( images_write_1D )
TEST_FN_REDIRECTOR( test_images_1D_getinfo ) TEST_FN_REDIRECTOR( images_1D_getinfo )
// 1D image arrays: // 1D image arrays:
TEST_FN_REDIRECTOR( test_images_read_1Darray ) TEST_FN_REDIRECTOR( images_read_1Darray )
TEST_FN_REDIRECTOR( test_images_write_1Darray ) TEST_FN_REDIRECTOR( images_write_1Darray )
TEST_FN_REDIRECTOR( test_images_1Darray_getinfo ) TEST_FN_REDIRECTOR( images_1Darray_getinfo )
// 2D images: // 2D images:
TEST_FN_REDIRECTOR( test_images_read_2D ) TEST_FN_REDIRECTOR( images_read_2D )
TEST_FN_REDIRECTOR( test_images_read_cube ) TEST_FN_REDIRECTOR( images_read_cube )
TEST_FN_REDIRECTOR( test_images_write ) TEST_FN_REDIRECTOR( images_write )
TEST_FN_REDIRECTOR( test_images_write_cube ) TEST_FN_REDIRECTOR( images_write_cube )
TEST_FN_REDIRECTOR( test_images_2D_getinfo ) TEST_FN_REDIRECTOR( images_2D_getinfo )
TEST_FN_REDIRECTOR( test_images_cube_getinfo ) TEST_FN_REDIRECTOR( images_cube_getinfo )
// 2D image arrays: // 2D image arrays:
TEST_FN_REDIRECTOR( test_images_read_2Darray ) TEST_FN_REDIRECTOR( images_read_2Darray )
TEST_FN_REDIRECTOR( test_images_write_2Darray ) TEST_FN_REDIRECTOR( images_write_2Darray )
TEST_FN_REDIRECTOR( test_images_2Darray_getinfo ) TEST_FN_REDIRECTOR( images_2Darray_getinfo )
// 3D images: // 3D images:
TEST_FN_REDIRECTOR( test_images_read_3D ) TEST_FN_REDIRECTOR( images_read_3D )
TEST_FN_REDIRECTOR( test_images_write_3D ) TEST_FN_REDIRECTOR( images_write_3D )
TEST_FN_REDIRECTOR( test_images_3D_getinfo ) TEST_FN_REDIRECTOR( images_3D_getinfo )
#ifdef GL_VERSION_3_2 #ifdef GL_VERSION_3_2
TEST_FN_REDIRECTOR( test_images_read_texturebuffer ) TEST_FN_REDIRECTOR( images_read_texturebuffer )
TEST_FN_REDIRECTOR( test_images_write_texturebuffer ) TEST_FN_REDIRECTOR( images_write_texturebuffer )
TEST_FN_REDIRECTOR( test_images_texturebuffer_getinfo ) TEST_FN_REDIRECTOR( images_texturebuffer_getinfo )
// depth textures // depth textures
TEST_FN_REDIRECTOR( test_images_read_2D_depth ) TEST_FN_REDIRECTOR( images_read_2D_depth )
TEST_FN_REDIRECTOR( test_images_write_2D_depth ) TEST_FN_REDIRECTOR( images_write_2D_depth )
TEST_FN_REDIRECTOR( test_images_read_2Darray_depth ) TEST_FN_REDIRECTOR( images_read_2Darray_depth )
TEST_FN_REDIRECTOR( test_images_write_2Darray_depth ) TEST_FN_REDIRECTOR( images_write_2Darray_depth )
TEST_FN_REDIRECTOR( test_images_read_2D_multisample ) TEST_FN_REDIRECTOR( images_read_2D_multisample )
TEST_FN_REDIRECTOR( test_images_read_2Darray_multisample ) TEST_FN_REDIRECTOR( images_read_2Darray_multisample )
TEST_FN_REDIRECTOR( test_image_methods_depth ); TEST_FN_REDIRECTOR( image_methods_depth )
TEST_FN_REDIRECTOR( test_image_methods_multisample ); TEST_FN_REDIRECTOR( image_methods_multisample )
#endif #endif
// Renderbuffer-backed images: // Renderbuffer-backed images:
TEST_FN_REDIRECTOR( test_renderbuffer_read ) TEST_FN_REDIRECTOR( renderbuffer_read )
TEST_FN_REDIRECTOR( test_renderbuffer_write ) TEST_FN_REDIRECTOR( renderbuffer_write )
TEST_FN_REDIRECTOR( test_renderbuffer_getinfo ) TEST_FN_REDIRECTOR( renderbuffer_getinfo )
TEST_FN_REDIRECTOR( test_fence_sync ) TEST_FN_REDIRECTOR( test_fence_sync )
basefn basefn_list[] = { test_definition test_list[] = {
TEST_FN_REDIRECT( test_buffers ), TEST_FN_REDIRECT( buffers ),
TEST_FN_REDIRECT( test_buffers_getinfo ), TEST_FN_REDIRECT( buffers_getinfo ),
TEST_FN_REDIRECT( test_images_read_1D ), TEST_FN_REDIRECT( images_read_1D ),
TEST_FN_REDIRECT( test_images_write_1D ), TEST_FN_REDIRECT( images_write_1D ),
TEST_FN_REDIRECT( test_images_1D_getinfo ), TEST_FN_REDIRECT( images_1D_getinfo ),
TEST_FN_REDIRECT( test_images_read_1Darray ), TEST_FN_REDIRECT( images_read_1Darray ),
TEST_FN_REDIRECT( test_images_write_1Darray ), TEST_FN_REDIRECT( images_write_1Darray ),
TEST_FN_REDIRECT( test_images_1Darray_getinfo ), TEST_FN_REDIRECT( images_1Darray_getinfo ),
TEST_FN_REDIRECT( test_images_read_2D ), TEST_FN_REDIRECT( images_read_2D ),
TEST_FN_REDIRECT( test_images_write ), TEST_FN_REDIRECT( images_write ),
TEST_FN_REDIRECT( test_images_2D_getinfo ), TEST_FN_REDIRECT( images_2D_getinfo ),
TEST_FN_REDIRECT( test_images_read_cube ), TEST_FN_REDIRECT( images_read_cube ),
TEST_FN_REDIRECT( test_images_write_cube ), TEST_FN_REDIRECT( images_write_cube ),
TEST_FN_REDIRECT( test_images_cube_getinfo ), TEST_FN_REDIRECT( images_cube_getinfo ),
TEST_FN_REDIRECT( test_images_read_2Darray ), TEST_FN_REDIRECT( images_read_2Darray ),
TEST_FN_REDIRECT( test_images_write_2Darray), TEST_FN_REDIRECT( images_write_2Darray),
TEST_FN_REDIRECT( test_images_2Darray_getinfo ), TEST_FN_REDIRECT( images_2Darray_getinfo ),
TEST_FN_REDIRECT( test_images_read_3D ), TEST_FN_REDIRECT( images_read_3D ),
TEST_FN_REDIRECT( test_images_write_3D ), TEST_FN_REDIRECT( images_write_3D ),
TEST_FN_REDIRECT( test_images_3D_getinfo ), TEST_FN_REDIRECT( images_3D_getinfo ),
TEST_FN_REDIRECT( test_renderbuffer_read ), TEST_FN_REDIRECT( renderbuffer_read ),
TEST_FN_REDIRECT( test_renderbuffer_write ), TEST_FN_REDIRECT( renderbuffer_write ),
TEST_FN_REDIRECT( test_renderbuffer_getinfo ) TEST_FN_REDIRECT( renderbuffer_getinfo )
}; };
basefn basefn_list32[] = { const int test_num = ARRAY_SIZE( test_list );
TEST_FN_REDIRECT( test_images_read_texturebuffer ), const int test_num32 = ARRAY_SIZE( test_list32 );
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 *);
cl_device_type gDeviceType = CL_DEVICE_TYPE_DEFAULT; cl_device_type gDeviceType = CL_DEVICE_TYPE_DEFAULT;
bool gTestRounding = true; bool gTestRounding = true;
@@ -253,12 +184,12 @@ int main(int argc, const char *argv[])
if( argc > 1 && strcmp( argv[ 1 ], "-list" ) == 0 ) if( argc > 1 && strcmp( argv[ 1 ], "-list" ) == 0 )
{ {
log_info( "Available 2.x tests:\n" ); log_info( "Available 2.x tests:\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( "Available 3.2 tests:\n" ); log_info( "Available 3.2 tests:\n" );
for( int i = 0; i < num_fns32; i++ ) for( int i = 0; i < test_num32; i++ )
log_info( "\t%s\n", basefn_names32[ 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( "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" ); log_info( "Use environment variables to specify desired device.\n" );
@@ -271,8 +202,8 @@ int main(int argc, const char *argv[])
unsigned first_32_testname = 0; unsigned first_32_testname = 0;
for (int j=1; (j<argc) && (!first_32_testname); ++j) for (int j=1; (j<argc) && (!first_32_testname); ++j)
for (int i=0;i<num_fns32;++i) for (int i = 0; i < test_num32; ++i)
if (strcmp(basefn_names32[i],argv[j])==0) { if (strcmp(test_list32[i].name, argv[j]) == 0) {
first_32_testname = j; first_32_testname = j;
break; break;
} }
@@ -359,7 +290,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) // 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 ) if( error != 0 )
break; break;
} }
@@ -432,7 +363,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) // 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 ) if( error != 0 )
break; break;
} }
@@ -450,4 +381,3 @@ int main(int argc, const char *argv[])
return numErrors; return numErrors;
} }

View File

@@ -38,82 +38,58 @@
static cl_context sCurrentContext = NULL; 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 ) \ #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; \ int error; \
clCommandQueueWrapper realQueue = clCreateCommandQueue( sCurrentContext, device, 0, &error ); \ clCommandQueueWrapper realQueue = clCreateCommandQueue( sCurrentContext, device, 0, &error ); \
test_error( error, "Unable to create command queue" ); \ 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( buffers )
TEST_FN_REDIRECTOR( test_buffers_getinfo ) TEST_FN_REDIRECTOR( buffers_getinfo )
TEST_FN_REDIRECTOR( test_images_read ) TEST_FN_REDIRECTOR( images_read )
TEST_FN_REDIRECTOR( test_images_2D_getinfo ) TEST_FN_REDIRECTOR( images_2D_getinfo )
TEST_FN_REDIRECTOR( test_images_read_cube ) TEST_FN_REDIRECTOR( images_read_cube )
TEST_FN_REDIRECTOR( test_images_cube_getinfo ) TEST_FN_REDIRECTOR( images_cube_getinfo )
TEST_FN_REDIRECTOR( test_images_read_3D ) TEST_FN_REDIRECTOR( images_read_3D )
TEST_FN_REDIRECTOR( test_images_3D_getinfo ) TEST_FN_REDIRECTOR( images_3D_getinfo )
TEST_FN_REDIRECTOR( test_images_write ) TEST_FN_REDIRECTOR( images_write )
TEST_FN_REDIRECTOR( test_images_write_cube ) TEST_FN_REDIRECTOR( images_write_cube )
TEST_FN_REDIRECTOR( test_renderbuffer_read ) TEST_FN_REDIRECTOR( renderbuffer_read )
TEST_FN_REDIRECTOR( test_renderbuffer_write ) TEST_FN_REDIRECTOR( renderbuffer_write )
TEST_FN_REDIRECTOR( test_renderbuffer_getinfo ) TEST_FN_REDIRECTOR( renderbuffer_getinfo )
#ifndef GL_ES_VERSION_2_0 #ifndef GL_ES_VERSION_2_0
TEST_FN_REDIRECTOR( test_fence_sync ) TEST_FN_REDIRECTOR( test_fence_sync )
#endif #endif
basefn basefn_list[] = { test_definition test_list[] = {
TEST_FN_REDIRECT( test_buffers ), TEST_FN_REDIRECT( buffers ),
TEST_FN_REDIRECT( test_buffers_getinfo ), TEST_FN_REDIRECT( buffers_getinfo ),
TEST_FN_REDIRECT( test_images_read ), TEST_FN_REDIRECT( images_read ),
TEST_FN_REDIRECT( test_images_2D_getinfo ), TEST_FN_REDIRECT( images_2D_getinfo ),
TEST_FN_REDIRECT( test_images_read_cube ), TEST_FN_REDIRECT( images_read_cube ),
TEST_FN_REDIRECT( test_images_cube_getinfo ), TEST_FN_REDIRECT( images_cube_getinfo ),
TEST_FN_REDIRECT( test_images_read_3D ), TEST_FN_REDIRECT( images_read_3D ),
TEST_FN_REDIRECT( test_images_3D_getinfo ), TEST_FN_REDIRECT( images_3D_getinfo ),
TEST_FN_REDIRECT( test_images_write ), TEST_FN_REDIRECT( images_write ),
TEST_FN_REDIRECT( test_images_write_cube ), TEST_FN_REDIRECT( images_write_cube ),
TEST_FN_REDIRECT( test_renderbuffer_read ), TEST_FN_REDIRECT( renderbuffer_read ),
TEST_FN_REDIRECT( test_renderbuffer_write ), TEST_FN_REDIRECT( renderbuffer_write ),
TEST_FN_REDIRECT( test_renderbuffer_getinfo ) TEST_FN_REDIRECT( renderbuffer_getinfo )
}; };
#ifndef GL_ES_VERSION_2_0 #ifndef GL_ES_VERSION_2_0
basefn basefn_list32[] = { test_definition test_list32[] = {
TEST_FN_REDIRECT( test_fence_sync ) TEST_FN_REDIRECT( fence_sync )
}; };
#endif #endif
const char *basefn_names[] = { const int test_num = ARRAY_SIZE( test_list );
"buffers", const int test_num32 = ARRAY_SIZE( test_list32 );
"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",
"all"
};
const char *basefn_names32[] = {
"fence_sync",
"all"
};
ct_assert((sizeof(basefn_names) / sizeof(basefn_names[0]) - 1) == (sizeof(basefn_list) / sizeof(basefn_list[0])));
int num_fns = sizeof(basefn_names) / sizeof(char *);
int num_fns32 = sizeof(basefn_names32) / sizeof(char *);
int main(int argc, const char *argv[]) int main(int argc, const char *argv[])
@@ -134,12 +110,12 @@ int main(int argc, const char *argv[])
if(strcmp( argv[ z ], "-list" ) == 0 ) if(strcmp( argv[ z ], "-list" ) == 0 )
{ {
log_info( "Available 2.x tests:\n" ); log_info( "Available 2.x tests:\n" );
for( int i = 0; i < num_fns - 1; 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( "Available 3.2 tests:\n" ); log_info( "Available 3.2 tests:\n" );
for( int i = 0; i < num_fns32 - 1; i++ ) for( int i = 0; i < test_num32; i++ )
log_info( "\t%s\n", basefn_names32[ 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( "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." ); log_info( "Use environment variables to specify desired device." );
@@ -168,8 +144,8 @@ int main(int argc, const char *argv[])
unsigned first_32_testname = 0; unsigned first_32_testname = 0;
for (int j=1; (j<argc) && (!first_32_testname); ++j) for (int j=1; (j<argc) && (!first_32_testname); ++j)
for (int i=0;i<num_fns32-1;++i) for (int i = 0; i < test_num32; ++i)
if (strcmp(basefn_names32[i],argv[j])==0) { if (strcmp(test_list32[i].name, argv[j]) == 0 ) {
first_32_testname = j; first_32_testname = j;
break; break;
} }
@@ -292,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) // 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 ) if( error != 0 )
break; break;
} }
@@ -369,7 +345,7 @@ int main(int argc, const char *argv[])
goto cleanup; goto cleanup;
#else #else
// Note: don't use the entire harness, because we have a different way of obtaining the device (via the context) // 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 ) if( error != 0 )
break; break;
#endif #endif

View File

@@ -18,7 +18,7 @@
#include "tests.h" #include "tests.h"
#include "../../test_common/harness/testHarness.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; int vectorSize, error;
uint64_t i, j; uint64_t i, j;

View File

@@ -617,12 +617,12 @@ exit:
return error; 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 ); 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 ); return Test_vLoadHalf_private( true );
} }

View File

@@ -612,7 +612,7 @@ double2half_rtn( double f )
return (u.u >> (53-11)) | sign; 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)) 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"); 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"); 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"); 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"); 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)) 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"); 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"); 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"); 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"); 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]; int g_arrVecAligns[kLargestVectorSize+1];
static int arrStrangeVecSizes[kStrangeVectorSizeCount] = {3}; static int arrStrangeVecSizes[kStrangeVectorSizeCount] = {3};
basefn basefn_list[] = { test_definition test_list[] = {
Test_vload_half, ADD_TEST( vload_half ),
Test_vloada_half, ADD_TEST( vloada_half ),
Test_vstore_half, ADD_TEST( vstore_half ),
Test_vstorea_half, ADD_TEST( vstorea_half ),
Test_vstore_half_rte, ADD_TEST( vstore_half_rte ),
Test_vstorea_half_rte, ADD_TEST( vstorea_half_rte ),
Test_vstore_half_rtz, ADD_TEST( vstore_half_rtz ),
Test_vstorea_half_rtz, ADD_TEST( vstorea_half_rtz ),
Test_vstore_half_rtp, ADD_TEST( vstore_half_rtp ),
Test_vstorea_half_rtp, ADD_TEST( vstorea_half_rtp ),
Test_vstore_half_rtn, ADD_TEST( vstore_half_rtn ),
Test_vstorea_half_rtn, ADD_TEST( vstorea_half_rtn ),
Test_roundTrip, ADD_TEST( roundTrip ),
}; };
const char *basefn_names[] = { const int test_num = ARRAY_SIZE( test_list );
"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 *);
int main (int argc, const char **argv ) int main (int argc, const char **argv )
{ {
@@ -102,14 +84,14 @@ int main (int argc, const char **argv )
} }
for(i = 0; i < kStrangeVectorSizeCount; ++i) { for(i = 0; i < kStrangeVectorSizeCount; ++i) {
g_arrVecSizes[i+kVectorSizeCount] = g_arrVecSizes[i+kVectorSizeCount] =
arrStrangeVecSizes[i]; arrStrangeVecSizes[i];
} }
for(i = 0, alignbound=1; i <= kLargestVectorSize; ++i) { for(i = 0, alignbound=1; i <= kLargestVectorSize; ++i) {
while(alignbound < i) { while(alignbound < i) {
alignbound = alignbound<<1; alignbound = alignbound<<1;
} }
g_arrVecAligns[i] = alignbound; g_arrVecAligns[i] = alignbound;
} }
test_start(); test_start();
@@ -135,7 +117,7 @@ int main (int argc, const char **argv )
} }
fflush( stdout ); 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: exit:
if(gQueue) if(gQueue)
@@ -343,9 +325,9 @@ static void PrintUsage( void )
vlog( "\t\t-w\tRun in wimpy mode\n" ); 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-[2^n]\tSet wimpy reduction factor, recommended range of n is 1-12, default factor(%u)\n", gWimpyReductionFactor);
vlog( "\t\t-h\tHelp\n" ); 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 #define TESTS_H
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
typedef cl_ushort (*f2h)( float ); typedef cl_ushort (*f2h)( float );
typedef cl_ushort (*d2h)( double ); typedef cl_ushort (*d2h)( double );

View File

@@ -1,7 +1,14 @@
set(HEADERS_SOURCES set(HEADERS_SOURCES
test_headers.c test_headers.c
../../test_common/harness/errorHelpers.c
../../test_common/harness/kernelHelpers.c
../../test_common/harness/testHarness.c
../../test_common/harness/msvc9.c
../../test_common/harness/parseParameters.cpp
) )
set_source_files_properties(${HEADERS_SOURCES} PROPERTIES LANGUAGE CXX)
set(HEADERS_OUT ${CONFORMANCE_PREFIX}headers${CONFORMANCE_SUFFIX}) set(HEADERS_OUT ${CONFORMANCE_PREFIX}headers${CONFORMANCE_SUFFIX})
add_executable( add_executable(

View File

@@ -20,20 +20,21 @@
#endif #endif
#include <stdio.h> #include <stdio.h>
#include "../../test_common/harness/errorHelpers.h" #include "../../test_common/harness/errorHelpers.h"
#include "../../test_common/harness/testHarness.h"
void test_char( void ); int test_char( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
void test_uchar( void ); int test_uchar(cl_device_id deviceID , cl_context context, cl_command_queue queue, int num_elements);
void test_short( void ); int test_short( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
void test_ushort( void ); int test_ushort( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
void test_int( void ); int test_int( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
void test_uint( void ); int test_uint( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
void test_long( void ); int test_long( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
void test_ulong( void ); int test_ulong( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
void test_float( void ); int test_float( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
void test_double( void ); int test_double( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
void test_char( void ) int test_char( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
{ {
/* char */ /* char */
/* Constructor */ /* Constructor */
@@ -90,9 +91,10 @@ void test_char( void )
#endif #endif
log_info( "\n" ); log_info( "\n" );
return 0;
} }
void test_uchar( void ) int test_uchar( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
{ {
/* uchar */ /* uchar */
/* Constructor */ /* Constructor */
@@ -149,9 +151,10 @@ void test_uchar( void )
#endif #endif
log_info( "\n" ); log_info( "\n" );
return 0;
} }
void test_short( void ) int test_short( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
{ {
/* short */ /* short */
/* Constructor */ /* Constructor */
@@ -208,9 +211,10 @@ void test_short( void )
#endif #endif
log_info( "\n" ); log_info( "\n" );
return 0;
} }
void test_ushort( void ) int test_ushort( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
{ {
/* ushort */ /* ushort */
/* Constructor */ /* Constructor */
@@ -267,9 +271,10 @@ void test_ushort( void )
#endif #endif
log_info( "\n" ); log_info( "\n" );
return 0;
} }
void test_int( void ) int test_int(cl_device_id deviceID , cl_context context, cl_command_queue queue, int num_elements)
{ {
/* int */ /* int */
/* Constructor */ /* Constructor */
@@ -326,9 +331,10 @@ void test_int( void )
#endif #endif
log_info( "\n" ); log_info( "\n" );
return 0;
} }
void test_uint( void ) int test_uint( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
{ {
/* uint */ /* uint */
/* Constructor */ /* Constructor */
@@ -385,9 +391,10 @@ void test_uint( void )
#endif #endif
log_info( "\n" ); log_info( "\n" );
return 0;
} }
void test_long( void ) int test_long( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
{ {
/* long */ /* long */
/* Constructor */ /* Constructor */
@@ -444,9 +451,10 @@ void test_long( void )
#endif #endif
log_info( "\n" ); log_info( "\n" );
return 0;
} }
void test_ulong( void ) int test_ulong( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
{ {
/* ulong */ /* ulong */
/* Constructor */ /* Constructor */
@@ -503,10 +511,10 @@ void test_ulong( void )
#endif #endif
log_info( "\n" ); log_info( "\n" );
return 0;
} }
int test_float( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
void test_float( void )
{ {
/* float */ /* float */
/* Constructor */ /* Constructor */
@@ -565,9 +573,10 @@ void test_float( void )
#endif #endif
log_info( "\n" ); log_info( "\n" );
return 0;
} }
void test_double( void ) int test_double( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
{ {
/* double */ /* double */
/* Constructor */ /* Constructor */
@@ -624,27 +633,27 @@ void test_double( void )
#endif #endif
log_info( "\n" ); log_info( "\n" );
}
int main( void )
{
test_start();
log_info( "\nChecking operations on cl_types.\nNumbers, where presented, should walk upward from 0, with step of 1:\n" );
test_char();
test_uchar();
test_short();
test_ushort();
test_int();
test_uint();
test_long();
test_ulong();
test_float();
test_double();
test_finish();
log_info("PASSED test.\n");
return 0; return 0;
} }
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 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, 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 ); return test_image_set( device, k3DTo2DArray );
} }
basefn basefn_list[] = { test_definition test_list[] = {
test_1D, ADD_TEST( 1D ),
test_2D, ADD_TEST( 2D ),
test_3D, ADD_TEST( 3D ),
test_1Darray, ADD_TEST( 1Darray ),
test_2Darray, ADD_TEST( 2Darray ),
test_2Dto3D, ADD_TEST( 2Dto3D ),
test_3Dto2D, ADD_TEST( 3Dto2D ),
test_2Darrayto2D, ADD_TEST( 2Darrayto2D ),
test_2Dto2Darray, ADD_TEST( 2Dto2Darray ),
test_2Darrayto3D, ADD_TEST( 2Darrayto3D ),
test_3Dto2Darray, ADD_TEST( 3Dto2Darray ),
}; };
const char *basefn_names[] = { const int test_num = ARRAY_SIZE( test_list );
"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 *);
int main(int argc, const char *argv[]) int main(int argc, const char *argv[])
{ {
@@ -259,7 +243,7 @@ int main(int argc, const char *argv[])
if( gTestSmallImages ) if( gTestSmallImages )
log_info( "Note: Using small test images\n" ); 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); error = clFinish(queue);
if (error) 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( "\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( "\n" );
log_info( "Test names:\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, k2DArray); return test_image_set(device, k2DArray);
} }
basefn basefn_list[] = { test_definition test_list[] = {
test_1D, ADD_TEST( 1D ),
test_2D, ADD_TEST( 2D ),
test_3D, ADD_TEST( 3D ),
test_1Darray, ADD_TEST( 1Darray ),
test_2Darray, ADD_TEST( 2Darray ),
}; };
const char *basefn_names[] = { const int test_num = ARRAY_SIZE( test_list );
"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 *);
int main(int argc, const char *argv[]) int main(int argc, const char *argv[])
{ {
@@ -224,7 +214,7 @@ int main(int argc, const char *argv[])
if ( gTestSmallImages ) if ( gTestSmallImages )
log_info( "Note: Using small test images\n" ); 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); error = clFinish(queue);
if (error) if (error)
@@ -272,9 +262,9 @@ static void printUsage( const char *execName )
log_info( "\tuse_pitches - Enables row and slice pitches\n" ); log_info( "\tuse_pitches - Enables row and slice pitches\n" );
log_info( "\n" ); log_info( "\n" );
log_info( "Test names:\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( "\n" );
log_info( "You may also use appropriate CL_ channel type and ordering constants.\n" ); log_info( "You may also use appropriate CL_ channel type and ordering constants.\n" );

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