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

@@ -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 verify_linked_lists_on_device_no_map(int qi, cl_command_queue q, cl_int *pNum_correct, cl_kernel k, cl_int ListLength, size_t numLists );
extern int test_byte_granularity(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_set_kernel_exec_info_svm_ptrs(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_fine_grain_memory_consistency(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_fine_grain_sync_buffers(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_shared_address_space_coarse_grain_old_api(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_shared_address_space_coarse_grain_new_api(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_shared_address_space_fine_grain_buffers(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_shared_address_space_fine_grain(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_cross_buffer_pointers_coarse_grain(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_byte_granularity(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_set_kernel_exec_info_svm_ptrs(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_fine_grain_memory_consistency(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_fine_grain_sync_buffers(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_shared_address_space_coarse_grain_old_api(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_shared_address_space_coarse_grain_new_api(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_shared_address_space_fine_grain_buffers(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_shared_address_space_fine_grain(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_cross_buffer_pointers_coarse_grain(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_pointer_passing(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_allocate_shared_buffer(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_shared_sub_buffers(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_enqueue_api(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_migrate(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_allocate_shared_buffer(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_shared_sub_buffers(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_svm_enqueue_api(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern 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);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -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
// update using a lock free technique. The correctness of the list is verfied on the host.
// This test requires the new OpenCL 2.0 atomic operations that implement the new seq_cst memory ordering.
int test_fine_grain_memory_consistency(cl_device_id deviceID, cl_context c, cl_command_queue queue, int num_elements)
int test_svm_fine_grain_memory_consistency(cl_device_id deviceID, cl_context c, cl_command_queue queue, int num_elements)
{
clContextWrapper context;
clProgramWrapper program;

View File

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

View File

@@ -73,8 +73,7 @@ wait_and_release(const char* s, cl_event* evs, int n)
return 0;
}
int
test_migrate(cl_device_id deviceID, cl_context c, cl_command_queue queue, int num_elements)
int test_svm_migrate(cl_device_id deviceID, cl_context c, cl_command_queue queue, int num_elements)
{
cl_uint amem[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.
//
int test_set_kernel_exec_info_svm_ptrs(cl_device_id deviceID, cl_context context2, cl_command_queue queue, int num_elements)
int test_svm_set_kernel_exec_info_svm_ptrs(cl_device_id deviceID, cl_context context2, cl_command_queue queue, int num_elements)
{
clContextWrapper c = NULL;
clProgramWrapper program = NULL;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -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
source, then get the binary, then use that binary to reload the program, and then verify */

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -20,11 +20,6 @@
int main(int argc, const char *argv[])
{
// Get list to all test functions
std::vector<basefn> testfn_list = autotest::test_suite::get_test_functions();
// 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);
auto& tests = autotest::test_suite::global_test_suite().test_defs;
return runTestHarness(argc, argv, tests.size(), tests.data(), false, false, 0);
}

View File

@@ -22,11 +22,6 @@
int main(int argc, const char *argv[])
{
// Get list to all test functions
std::vector<basefn> testfn_list = autotest::test_suite::get_test_functions();
// 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);
auto& tests = autotest::test_suite::global_test_suite().test_defs;
return runTestHarness(argc, argv, tests.size(), tests.data(), false, false, 0);
}

View File

@@ -20,11 +20,6 @@
int main(int argc, const char *argv[])
{
// Get list to all test functions
std::vector<basefn> testfn_list = autotest::test_suite::get_test_functions();
// 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);
auto& tests = autotest::test_suite::global_test_suite().test_defs;
return runTestHarness(argc, argv, tests.size(), tests.data(), false, false, 0);
}

View File

@@ -22,11 +22,6 @@
int main(int argc, const char *argv[])
{
// Get list to all test functions
std::vector<basefn> testfn_list = autotest::test_suite::get_test_functions();
// 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);
auto& tests = autotest::test_suite::global_test_suite().test_defs;
return runTestHarness(argc, argv, tests.size(), tests.data(), false, false, 0);
}

View File

@@ -38,11 +38,6 @@ int main(int argc, const char *argv[])
);
}
// Get list to all test functions
std::vector<basefn> testfn_list = autotest::test_suite::get_test_functions();
// 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);
auto& tests = autotest::test_suite::global_test_suite().test_defs;
return runTestHarness(argc, argv, tests.size(), tests.data(), false, false, 0);
}

View File

@@ -20,11 +20,6 @@
int main(int argc, const char *argv[])
{
// Get list to all test functions
std::vector<basefn> testfn_list = autotest::test_suite::get_test_functions();
// 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);
auto& tests = autotest::test_suite::global_test_suite().test_defs;
return runTestHarness(argc, argv, tests.size(), tests.data(), false, false, 0);
}

View File

@@ -20,11 +20,6 @@
int main(int argc, const char *argv[])
{
// Get list to all test functions
std::vector<basefn> testfn_list = autotest::test_suite::get_test_functions();
// 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);
auto& tests = autotest::test_suite::global_test_suite().test_defs;
return runTestHarness(argc, argv, tests.size(), tests.data(), false, false, 0);
}

View File

@@ -39,11 +39,6 @@ int main(int argc, const char *argv[])
);
}
// Get list to all test functions
std::vector<basefn> testfn_list = autotest::test_suite::get_test_functions();
// 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);
auto& tests = autotest::test_suite::global_test_suite().test_defs;
return runTestHarness(argc, argv, tests.size(), tests.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[])
{
// Get list to all test functions
std::vector<basefn> testfn_list = autotest::test_suite::get_test_functions();
// 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);
auto& tests = autotest::test_suite::global_test_suite().test_defs;
return runTestHarness(argc, argv, tests.size(), tests.data(), false, false, 0);
}

View File

@@ -21,11 +21,6 @@
int main(int argc, const char *argv[])
{
// Get list to all test functions
std::vector<basefn> testfn_list = autotest::test_suite::get_test_functions();
// 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);
auto& tests = autotest::test_suite::global_test_suite().test_defs;
return runTestHarness(argc, argv, tests.size(), tests.data(), false, false, 0);
}

View File

@@ -45,11 +45,6 @@ int main(int argc, const char *argv[])
);
}
// Get list to all test functions
std::vector<basefn> testfn_list = autotest::test_suite::get_test_functions();
// 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);
auto& tests = autotest::test_suite::global_test_suite().test_defs;
return runTestHarness(argc, argv, tests.size(), tests.data(), false, false, 0);
}

View File

@@ -20,11 +20,6 @@
int main(int argc, const char *argv[])
{
// Get list to all test functions
std::vector<basefn> testfn_list = autotest::test_suite::get_test_functions();
// 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);
auto& tests = autotest::test_suite::global_test_suite().test_defs;
return runTestHarness(argc, argv, tests.size(), tests.data(), false, false, 0);
}

View File

@@ -19,11 +19,6 @@
int main(int argc, const char *argv[])
{
// Get list to all test functions
std::vector<basefn> testfn_list = autotest::test_suite::get_test_functions();
// 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);
auto& tests = autotest::test_suite::global_test_suite().test_defs;
return runTestHarness(argc, argv, tests.size(), tests.data(), false, false, 0);
}

View File

@@ -20,11 +20,6 @@
int main(int argc, const char *argv[])
{
// Get list to all test functions
std::vector<basefn> testfn_list = autotest::test_suite::get_test_functions();
// 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);
auto& tests = autotest::test_suite::global_test_suite().test_defs;
return runTestHarness(argc, argv, tests.size(), tests.data(), false, false, 0);
}

View File

@@ -21,11 +21,6 @@
int main(int argc, const char *argv[])
{
// Get list to all test functions
std::vector<basefn> testfn_list = autotest::test_suite::get_test_functions();
// 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);
auto& tests = autotest::test_suite::global_test_suite().test_defs;
return runTestHarness(argc, argv, tests.size(), tests.data(), false, false, 0);
}

View File

@@ -21,11 +21,6 @@
int main(int argc, const char *argv[])
{
// Get list to all test functions
std::vector<basefn> testfn_list = autotest::test_suite::get_test_functions();
// 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);
auto& tests = autotest::test_suite::global_test_suite().test_defs;
return runTestHarness(argc, argv, tests.size(), tests.data(), false, false, 0);
}

View File

@@ -24,11 +24,6 @@
int main(int argc, const char *argv[])
{
// Get list to all test functions
std::vector<basefn> testfn_list = autotest::test_suite::get_test_functions();
// 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);
auto& tests = autotest::test_suite::global_test_suite().test_defs;
return runTestHarness(argc, argv, tests.size(), tests.data(), false, false, 0);
}

View File

@@ -22,11 +22,6 @@
int main(int argc, const char *argv[])
{
// Get list to all test functions
std::vector<basefn> testfn_list = autotest::test_suite::get_test_functions();
// 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);
auto& tests = autotest::test_suite::global_test_suite().test_defs;
return runTestHarness(argc, argv, tests.size(), tests.data(), false, false, 0);
}

View File

@@ -20,11 +20,6 @@
int main(int argc, const char *argv[])
{
// Get list to all test functions
std::vector<basefn> testfn_list = autotest::test_suite::get_test_functions();
// 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);
auto& tests = autotest::test_suite::global_test_suite().test_defs;
return runTestHarness(argc, argv, tests.size(), tests.data(), false, false, 0);
}

View File

@@ -24,11 +24,6 @@
int main(int argc, const char *argv[])
{
// Get list to all test functions
std::vector<basefn> testfn_list = autotest::test_suite::get_test_functions();
// 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);
auto& tests = autotest::test_suite::global_test_suite().test_defs;
return runTestHarness(argc, argv, tests.size(), tests.data(), false, false, 0);
}

View File

@@ -20,11 +20,6 @@
int main(int argc, const char *argv[])
{
// Get list to all test functions
std::vector<basefn> testfn_list = autotest::test_suite::get_test_functions();
// 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);
auto& tests = autotest::test_suite::global_test_suite().test_defs;
return runTestHarness(argc, argv, tests.size(), tests.data(), false, false, 0);
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -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 total_errors = 0;
cl_platform_id platform;
err = clGetPlatformIDs(1, &platform, NULL);
test_error(err, "clGetPlatformIDs failed");
@@ -864,14 +853,40 @@ int main(int argc, const char** argv)
}
}
if (total_errors)
log_error("FAILED computeinfo.\n");
else
log_info("PASSED computeinfo.\n");
test_finish();
if (total_errors)
return -1;
return 0;
return total_errors;
}
test_definition test_list[] = {
ADD_TEST( computeinfo ),
};
const int test_num = ARRAY_SIZE( test_list );
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);
}
basefn basefn_list[] = {
test_contractions_float_0,
test_contractions_float_1,
test_contractions_float_2,
test_contractions_float_3,
test_contractions_float_4,
test_contractions_float_5,
test_contractions_float_6,
test_contractions_float_7,
test_contractions_double_0,
test_contractions_double_1,
test_contractions_double_2,
test_contractions_double_3,
test_contractions_double_4,
test_contractions_double_5,
test_contractions_double_6,
test_contractions_double_7,
test_definition test_list[] = {
ADD_TEST( contractions_float_0 ),
ADD_TEST( contractions_float_1 ),
ADD_TEST( contractions_float_2 ),
ADD_TEST( contractions_float_3 ),
ADD_TEST( contractions_float_4 ),
ADD_TEST( contractions_float_5 ),
ADD_TEST( contractions_float_6 ),
ADD_TEST( contractions_float_7 ),
ADD_TEST( contractions_double_0 ),
ADD_TEST( contractions_double_1 ),
ADD_TEST( contractions_double_2 ),
ADD_TEST( contractions_double_3 ),
ADD_TEST( contractions_double_4 ),
ADD_TEST( contractions_double_5 ),
ADD_TEST( contractions_double_6 ),
ADD_TEST( contractions_double_7 ),
};
const char *basefn_names[] = {
"contractions_float_0",
"contractions_float_1",
"contractions_float_2",
"contractions_float_3",
"contractions_float_4",
"contractions_float_5",
"contractions_float_6",
"contractions_float_7",
"contractions_double_0",
"contractions_double_1",
"contractions_double_2",
"contractions_double_3",
"contractions_double_4",
"contractions_double_5",
"contractions_double_6",
"contractions_double_7",
};
ct_assert((sizeof(basefn_names) / sizeof(basefn_names[0])) == (sizeof(basefn_list) / sizeof(basefn_list[0])));
int num_fns = sizeof(basefn_names) / sizeof(char *);
const int test_num = ARRAY_SIZE( test_list );
int main( int argc, const char **argv )
{
@@ -362,7 +341,7 @@ int main( int argc, const char **argv )
if( error )
goto exit;
error = parseAndCallCommandLineTests( gArgCount, gArgList, NULL, num_fns, basefn_list, basefn_names, true, 0, 0 );
error = parseAndCallCommandLineTests( gArgCount, gArgList, NULL, test_num, test_list, true, 0, 0 );
exit:
if( gQueue )
@@ -571,9 +550,9 @@ static void PrintUsage( void )
vlog( "\t\t-sNUMBER set random seed.\n");
vlog( "\n" );
vlog( "\tTest names:\n" );
for( int i = 0; i < num_fns; i++ )
for( int i = 0; i < test_num; i++ )
{
vlog( "\t\t%s\n", basefn_names[i] );
vlog( "\t\t%s\n", test_list[i].name );
}
}

View File

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

View File

@@ -28,46 +28,25 @@
std::string gKernelName;
int gWimpyMode = 0;
basefn basefn_list[] =
{
test_definition test_list[] = {
#ifdef CL_VERSION_2_0
test_device_info,
test_device_queue,
test_execute_block,
test_enqueue_block,
test_enqueue_nested_blocks,
test_enqueue_wg_size,
test_enqueue_flags,
test_enqueue_multi_queue,
test_host_multi_queue,
test_enqueue_ndrange,
test_host_queue_order,
ADD_TEST( device_info ),
ADD_TEST( device_queue ),
ADD_TEST( execute_block ),
ADD_TEST( enqueue_block ),
ADD_TEST( enqueue_nested_blocks ),
ADD_TEST( enqueue_wg_size ),
ADD_TEST( enqueue_flags ),
ADD_TEST( enqueue_multi_queue ),
ADD_TEST( host_multi_queue ),
ADD_TEST( enqueue_ndrange ),
ADD_TEST( host_queue_order ),
#endif
};
const char *commonfn_names[] =
{
#ifdef CL_VERSION_2_0
"test_device_info",
"test_device_queue",
"test_execute_block",
"test_enqueue_block",
"test_enqueue_nested_blocks",
"test_enqueue_wg_size",
"test_enqueue_flags",
"test_enqueue_multi_queue",
"test_host_multi_queue",
"test_enqueue_ndrange",
"test_host_queue_order",
#endif
};
const int test_num = ARRAY_SIZE( test_list );
ct_assert(arr_size(commonfn_names) == arr_size(basefn_list))
static const int num_commonfns = arr_size(commonfn_names);
int
main(int argc, const char *argv[])
int main(int argc, const char *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>
#endif
basefn basefn_list[] = {
test_partition_equally,
test_partition_by_counts,
test_partition_by_affinity_domain_numa,
test_partition_by_affinity_domain_l4_cache,
test_partition_by_affinity_domain_l3_cache,
test_partition_by_affinity_domain_l2_cache,
test_partition_by_affinity_domain_l1_cache,
test_partition_by_affinity_domain_next_partitionable,
test_partition
test_definition test_list[] = {
ADD_TEST( partition_equally ),
ADD_TEST( partition_by_counts ),
ADD_TEST( partition_by_affinity_domain_numa ),
ADD_TEST( partition_by_affinity_domain_l4_cache ),
ADD_TEST( partition_by_affinity_domain_l3_cache ),
ADD_TEST( partition_by_affinity_domain_l2_cache ),
ADD_TEST( partition_by_affinity_domain_l1_cache ),
ADD_TEST( partition_by_affinity_domain_next_partitionable ),
ADD_TEST( partition_all ),
};
const char *basefn_names[] = {
"device_partition_equally",
"device_partition_by_counts",
"device_partition_by_affinity_domain_numa",
"device_partition_by_affinity_domain_l4_cache",
"device_partition_by_affinity_domain_l3_cache",
"device_partition_by_affinity_domain_l2_cache",
"device_partition_by_affinity_domain_l1_cache",
"device_partition_by_affinity_domain_next_partitionable",
"device_partition_all",
};
ct_assert((sizeof(basefn_names) / sizeof(basefn_names[0])) == (sizeof(basefn_list) / sizeof(basefn_list[0])));
int num_fns = sizeof(basefn_names) / sizeof(char *);
const int test_num = ARRAY_SIZE( test_list );
int main(int argc, const char *argv[])
{
return runTestHarness( argc, argv, num_fns, basefn_list, basefn_names, false, true, 0 );
return runTestHarness( argc, argv, test_num, test_list, false, true, 0 );
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,7 +1,14 @@
set(HEADERS_SOURCES
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})
add_executable(

View File

@@ -20,20 +20,21 @@
#endif
#include <stdio.h>
#include "../../test_common/harness/errorHelpers.h"
#include "../../test_common/harness/testHarness.h"
void test_char( void );
void test_uchar( void );
void test_short( void );
void test_ushort( void );
void test_int( void );
void test_uint( void );
void test_long( void );
void test_ulong( void );
void test_float( void );
void test_double( void );
int test_char( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
int test_uchar(cl_device_id deviceID , cl_context context, cl_command_queue queue, int num_elements);
int test_short( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
int test_ushort( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
int test_int( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
int test_uint( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
int test_long( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
int test_ulong( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
int test_float( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
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 */
/* Constructor */
@@ -90,9 +91,10 @@ void test_char( void )
#endif
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 */
/* Constructor */
@@ -149,9 +151,10 @@ void test_uchar( void )
#endif
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 */
/* Constructor */
@@ -208,9 +211,10 @@ void test_short( void )
#endif
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 */
/* Constructor */
@@ -267,9 +271,10 @@ void test_ushort( void )
#endif
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 */
/* Constructor */
@@ -326,9 +331,10 @@ void test_int( void )
#endif
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 */
/* Constructor */
@@ -385,9 +391,10 @@ void test_uint( void )
#endif
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 */
/* Constructor */
@@ -444,9 +451,10 @@ void test_long( void )
#endif
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 */
/* Constructor */
@@ -503,10 +511,10 @@ void test_ulong( void )
#endif
log_info( "\n" );
return 0;
}
void test_float( void )
int test_float( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
{
/* float */
/* Constructor */
@@ -565,9 +573,10 @@ void test_float( void )
#endif
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 */
/* Constructor */
@@ -624,27 +633,27 @@ void test_double( void )
#endif
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;
}
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 );
}
basefn basefn_list[] = {
test_1D,
test_2D,
test_3D,
test_1Darray,
test_2Darray,
test_2Dto3D,
test_3Dto2D,
test_2Darrayto2D,
test_2Dto2Darray,
test_2Darrayto3D,
test_3Dto2Darray,
test_definition test_list[] = {
ADD_TEST( 1D ),
ADD_TEST( 2D ),
ADD_TEST( 3D ),
ADD_TEST( 1Darray ),
ADD_TEST( 2Darray ),
ADD_TEST( 2Dto3D ),
ADD_TEST( 3Dto2D ),
ADD_TEST( 2Darrayto2D ),
ADD_TEST( 2Dto2Darray ),
ADD_TEST( 2Darrayto3D ),
ADD_TEST( 3Dto2Darray ),
};
const char *basefn_names[] = {
"1D",
"2D",
"3D",
"1Darray",
"2Darray",
"2Dto3D",
"3Dto2D",
"2Darrayto2D",
"2Dto2Darray",
"2Darrayto3D",
"3Dto2Darray",
};
ct_assert((sizeof(basefn_names) / sizeof(basefn_names[0])) == (sizeof(basefn_list) / sizeof(basefn_list[0])));
int num_fns = sizeof(basefn_names) / sizeof(char *);
const int test_num = ARRAY_SIZE( test_list );
int main(int argc, const char *argv[])
{
@@ -259,7 +243,7 @@ int main(int argc, const char *argv[])
if( gTestSmallImages )
log_info( "Note: Using small test images\n" );
int ret = parseAndCallCommandLineTests( argCount, argList, NULL, num_fns, basefn_list, basefn_names, true, 0, 0 );
int ret = parseAndCallCommandLineTests( argCount, argList, NULL, test_num, test_list, true, 0, 0 );
error = clFinish(queue);
if (error)
@@ -303,8 +287,8 @@ static void printUsage( const char *execName )
log_info( "\tuse_ramp - Instead of random data, uses images filled with ramps (and 0xff on any padding pixels) to ease debugging\n" );
log_info( "\n" );
log_info( "Test names:\n" );
for( int i = 0; i < num_fns; i++ )
for( int i = 0; i < test_num; i++ )
{
log_info( "\t%s\n", basefn_names[i] );
log_info( "\t%s\n", test_list[i].name );
}
}

View File

@@ -61,25 +61,15 @@ int test_2Darray(cl_device_id deviceID, cl_context context, cl_command_queue que
return test_image_set(device, k2DArray);
}
basefn basefn_list[] = {
test_1D,
test_2D,
test_3D,
test_1Darray,
test_2Darray,
test_definition test_list[] = {
ADD_TEST( 1D ),
ADD_TEST( 2D ),
ADD_TEST( 3D ),
ADD_TEST( 1Darray ),
ADD_TEST( 2Darray ),
};
const char *basefn_names[] = {
"1D",
"2D",
"3D",
"1Darray",
"2Darray",
};
ct_assert((sizeof(basefn_names) / sizeof(basefn_names[0])) == (sizeof(basefn_list) / sizeof(basefn_list[0])));
int num_fns = sizeof(basefn_names) / sizeof(char *);
const int test_num = ARRAY_SIZE( test_list );
int main(int argc, const char *argv[])
{
@@ -224,7 +214,7 @@ int main(int argc, const char *argv[])
if ( gTestSmallImages )
log_info( "Note: Using small test images\n" );
int ret = parseAndCallCommandLineTests( argCount, argList, NULL, num_fns, basefn_list, basefn_names, true, 0, 0 );
int ret = parseAndCallCommandLineTests( argCount, argList, NULL, test_num, test_list, true, 0, 0 );
error = clFinish(queue);
if (error)
@@ -272,9 +262,9 @@ static void printUsage( const char *execName )
log_info( "\tuse_pitches - Enables row and slice pitches\n" );
log_info( "\n" );
log_info( "Test names:\n" );
for( int i = 0; i < num_fns; i++ )
for( int i = 0; i < test_num; i++ )
{
log_info( "\t%s\n", basefn_names[i] );
log_info( "\t%s\n", test_list[i].name );
}
log_info( "\n" );
log_info( "You may also use appropriate CL_ channel type and ordering constants.\n" );

View File

@@ -27,106 +27,113 @@
bool gDebugTrace = false, gTestSmallImages = false, gTestMaxImages = false, gTestRounding = false;
int gTypesToTest = 0;
static bool gTest3DImages = true;
cl_channel_type gChannelTypeToUse = (cl_channel_type)-1;
cl_device_type gDeviceType = CL_DEVICE_TYPE_DEFAULT;
cl_command_queue queue;
cl_context context;
static cl_device_id device;
extern int test_image_set( cl_device_id device, cl_mem_object_type image_type );
static void printUsage( const char *execName );
#define MAX_ALLOWED_STD_DEVIATION_IN_MB 8.0
void printUsage( const char *execName )
int test_1D(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
const char *p = strrchr( execName, '/' );
if( p != NULL )
execName = p + 1;
return test_image_set( device, CL_MEM_OBJECT_IMAGE1D );
}
int test_2D(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
return test_image_set( device, CL_MEM_OBJECT_IMAGE2D );
}
int test_3D(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
if( !gTest3DImages )
{
log_info("3D image is not supported, test not run.\n");
return 0;
}
log_info( "Usage: %s [debug_trace] [1D|2D|3D|1Darray|2Darray] [small_images|max_images] [randomize]\n", execName );
log_info( "Where:\n" );
log_info( "\t1D - Only test 1D images\n" );
log_info( "\t2D - Only test 2D images\n" );
log_info( "\t3D - Only test 3D images\n" );
log_info( "\t1Darray - Only test 1D image arrays\n" );
log_info( "\t2Darray - Only test 2D image arrays\n" );
log_info( "\n" );
log_info( "\tdebug_trace - Enables additional debug info logging (default no debug info)\n" );
log_info( "\n" );
log_info( "\tsmall_images - Runs every format through a loop of widths 1-13 and heights 1-9, instead of random sizes (default test random sizes)\n" );
log_info( "\tmax_images - Runs every format through a set of size combinations with the max values, max values - 1, and max values / 128 (default test random sizes)\n" );
log_info( "\n" );
log_info( "\trandomize - Seed random number generator (default do not seed random number generator)\n" );
return test_image_set( device, CL_MEM_OBJECT_IMAGE3D );
}
int test_1Darray(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
return test_image_set( device, CL_MEM_OBJECT_IMAGE1D_ARRAY );
}
int test_2Darray(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
return test_image_set( device, CL_MEM_OBJECT_IMAGE2D_ARRAY );
}
test_definition test_list[] = {
ADD_TEST( 1D ),
ADD_TEST( 2D ),
ADD_TEST( 3D ),
ADD_TEST( 1Darray ),
ADD_TEST( 2Darray ),
};
const int test_num = ARRAY_SIZE( test_list );
int main(int argc, const char *argv[])
{
cl_platform_id platform;
cl_device_id device;
cl_channel_type chanType;
char str[ 128 ];
bool test3DImages = true;
bool randomize = false;
int testMethods = 0;
test_start();
checkDeviceTypeOverride( &gDeviceType );
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;
// Parse arguments
for( int i = 1; i < argc; i++ )
{
strncpy( str, argv[ i ], sizeof( str ) - 1 );
if( strcmp( str, "cpu" ) == 0 || strcmp( str, "CL_DEVICE_TYPE_CPU" ) == 0 )
if( strcmp( argv[i], "cpu" ) == 0 || strcmp( argv[i], "CL_DEVICE_TYPE_CPU" ) == 0 )
gDeviceType = CL_DEVICE_TYPE_CPU;
else if( strcmp( str, "gpu" ) == 0 || strcmp( str, "CL_DEVICE_TYPE_GPU" ) == 0 )
else if( strcmp( argv[i], "gpu" ) == 0 || strcmp( argv[i], "CL_DEVICE_TYPE_GPU" ) == 0 )
gDeviceType = CL_DEVICE_TYPE_GPU;
else if( strcmp( str, "accelerator" ) == 0 || strcmp( str, "CL_DEVICE_TYPE_ACCELERATOR" ) == 0 )
else if( strcmp( argv[i], "accelerator" ) == 0 || strcmp( argv[i], "CL_DEVICE_TYPE_ACCELERATOR" ) == 0 )
gDeviceType = CL_DEVICE_TYPE_ACCELERATOR;
else if( strcmp( str, "CL_DEVICE_TYPE_DEFAULT" ) == 0 )
else if( strcmp( argv[i], "CL_DEVICE_TYPE_DEFAULT" ) == 0 )
gDeviceType = CL_DEVICE_TYPE_DEFAULT;
else if( strcmp( str, "debug_trace" ) == 0 )
else if( strcmp( argv[i], "debug_trace" ) == 0 )
gDebugTrace = true;
else if( strcmp( str, "small_images" ) == 0 )
else if( strcmp( argv[i], "small_images" ) == 0 )
gTestSmallImages = true;
else if( strcmp( str, "max_images" ) == 0 )
else if( strcmp( argv[i], "max_images" ) == 0 )
gTestMaxImages = true;
else if( strcmp( str, "randomize" ) == 0 )
else if( strcmp( argv[i], "randomize" ) == 0 )
randomize = true;
else if( strcmp( str, "1D" ) == 0 )
testMethods |= k1D;
else if( strcmp( str, "2D" ) == 0 )
testMethods |= k2D;
else if( strcmp( str, "3D" ) == 0 )
testMethods |= k3D;
else if( strcmp( str, "1Darray" ) == 0 )
testMethods |= k1DArray;
else if( strcmp( str, "2Darray" ) == 0 )
testMethods |= k2DArray;
else if( strcmp( str, "help" ) == 0 || strcmp( str, "?" ) == 0 )
else if( strcmp( argv[i], "--help" ) == 0 || strcmp( argv[i], "-h" ) == 0 )
{
printUsage( argv[ 0 ] );
return -1;
}
else if( ( chanType = get_channel_type_from_name( str ) ) != (cl_channel_type)-1 )
else if( ( chanType = get_channel_type_from_name( argv[i] ) ) != (cl_channel_type)-1 )
gChannelTypeToUse = chanType;
else
{
log_error( "ERROR: Unknown argument %d: %s. Exiting....\n", i, str );
return -1;
else
{
argList[argCount] = argv[i];
argCount++;
}
}
}
if ( testMethods == 0 )
testMethods = k1D | k2D | k3D | k1DArray | k2DArray;
// Seed the random # generators
if( randomize )
{
@@ -225,7 +232,7 @@ int main(int argc, const char *argv[])
return -1;
}
test3DImages = false;
gTest3DImages = false;
}
}
@@ -250,38 +257,47 @@ int main(int argc, const char *argv[])
if( gTestSmallImages )
log_info( "Note: Using small test images\n" );
// Run the test now
int ret = 0;
if (testMethods & k1D)
ret += test_image_set( device, CL_MEM_OBJECT_IMAGE1D );
if (testMethods & k2D)
ret += test_image_set( device, CL_MEM_OBJECT_IMAGE2D );
if (test3DImages && (testMethods & k3D))
ret += test_image_set( device, CL_MEM_OBJECT_IMAGE3D );
if (testMethods & k1DArray)
ret += test_image_set( device, CL_MEM_OBJECT_IMAGE1D_ARRAY );
if (testMethods & k2DArray)
ret += test_image_set( device, CL_MEM_OBJECT_IMAGE2D_ARRAY );
int ret = parseAndCallCommandLineTests( argCount, argList, NULL, test_num, test_list, true, 0, 0 );
if (gTestFailure == 0) {
if (gTestCount > 1)
log_info("PASSED %d of %d tests.\n", gTestCount, gTestCount);
log_info("PASSED %d of %d sub-tests.\n", gTestCount, gTestCount);
else
log_info("PASSED test.\n");
log_info("PASSED sub-test.\n");
} else if (gTestFailure > 0) {
if (gTestCount > 1)
log_error("FAILED %d of %d tests.\n", gTestFailure, gTestCount);
log_error("FAILED %d of %d sub-tests.\n", gTestFailure, gTestCount);
else
log_error("FAILED test.\n");
log_error("FAILED sub-test.\n");
}
// Clean up
clReleaseCommandQueue(queue);
clReleaseContext(context);
free(argList);
test_finish();
if (gTestFailure > 0)
return gTestFailure;
return ret;
}
static void printUsage( const char *execName )
{
const char *p = strrchr( execName, '/' );
if( p != NULL )
execName = p + 1;
log_info( "Usage: %s [options] [test_names]\n", execName );
log_info( "Options:\n" );
log_info( "\tdebug_trace - Enables additional debug info logging (default no debug info)\n" );
log_info( "\n" );
log_info( "\tsmall_images - Runs every format through a loop of widths 1-13 and heights 1-9, instead of random sizes (default test random sizes)\n" );
log_info( "\tmax_images - Runs every format through a set of size combinations with the max values, max values - 1, and max values / 128 (default test random sizes)\n" );
log_info( "\n" );
log_info( "\trandomize - Seed random number generator (default do not seed random number generator)\n" );
log_info( "\n" );
log_info( "Test names:\n" );
for( int i = 0; i < test_num; i++ )
{
log_info( "\t%s\n", test_list[i].name );
}
}

View File

@@ -32,108 +32,110 @@ bool gEnablePitch = false;
cl_device_type gDeviceType = CL_DEVICE_TYPE_DEFAULT;
cl_command_queue queue;
cl_context context;
static cl_device_id device;
#define MAX_ALLOWED_STD_DEVIATION_IN_MB 8.0
void printUsage( const char *execName )
{
const char *p = strrchr( execName, '/' );
if( p != NULL )
execName = p + 1;
log_info( "Usage: %s [debug_trace] [small_images]\n", execName );
log_info( "Where:\n" );
log_info( "\t1D - Only test 1D images\n" );
log_info( "\t2D - Only test 2D images\n" );
log_info( "\t3D - Only test 3D images\n" );
log_info( "\t1Darray - Only test 1D image arrays\n" );
log_info( "\t2Darray - Only test 2D image arrays\n" );
log_info( "\n" );
log_info( "\tdebug_trace - Enables additional debug info logging\n" );
log_info( "\tsmall_images - Runs every format through a loop of widths 1-13 and heights 1-9, instead of random sizes\n" );
log_info( "\tmax_images - Runs every format through a set of size combinations with the max values, max values - 1, and max values / 128\n" );
log_info( "\trounding - Runs every format through a single image filled with every possible value for that image format, to verify rounding works properly\n" );
log_info( "\tuse_pitches - Enables row and slice pitches\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( "\ttest_mipmaps - Test mipmapped images\n" );
}
static void printUsage( const char *execName );
extern int test_image_set( cl_device_id device, cl_mem_object_type image_type );
int test_1D(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
return test_image_set( device, CL_MEM_OBJECT_IMAGE1D );
}
int test_2D(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
return test_image_set( device, CL_MEM_OBJECT_IMAGE2D );
}
int test_3D(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
return test_image_set( device, CL_MEM_OBJECT_IMAGE3D );
}
int test_1Darray(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
return test_image_set( device, CL_MEM_OBJECT_IMAGE1D_ARRAY );
}
int test_2Darray(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
return test_image_set( device, CL_MEM_OBJECT_IMAGE2D_ARRAY );
}
test_definition test_list[] = {
ADD_TEST( 1D ),
ADD_TEST( 2D ),
ADD_TEST( 3D ),
ADD_TEST( 1Darray ),
ADD_TEST( 2Darray ),
};
const int test_num = ARRAY_SIZE( test_list );
int main(int argc, const char *argv[])
{
cl_platform_id platform;
cl_device_id device;
cl_channel_type chanType;
char str[ 128 ];
bool randomize = false;
int testMethods = 0;
test_start();
checkDeviceTypeOverride( &gDeviceType );
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;
// Parse arguments
for( int i = 1; i < argc; i++ )
{
strncpy( str, argv[ i ], sizeof( str ) - 1 );
if( strcmp( str, "cpu" ) == 0 || strcmp( str, "CL_DEVICE_TYPE_CPU" ) == 0 )
if( strcmp( argv[i], "cpu" ) == 0 || strcmp( argv[i], "CL_DEVICE_TYPE_CPU" ) == 0 )
gDeviceType = CL_DEVICE_TYPE_CPU;
else if( strcmp( str, "gpu" ) == 0 || strcmp( str, "CL_DEVICE_TYPE_GPU" ) == 0 )
else if( strcmp( argv[i], "gpu" ) == 0 || strcmp( argv[i], "CL_DEVICE_TYPE_GPU" ) == 0 )
gDeviceType = CL_DEVICE_TYPE_GPU;
else if( strcmp( str, "accelerator" ) == 0 || strcmp( str, "CL_DEVICE_TYPE_ACCELERATOR" ) == 0 )
else if( strcmp( argv[i], "accelerator" ) == 0 || strcmp( argv[i], "CL_DEVICE_TYPE_ACCELERATOR" ) == 0 )
gDeviceType = CL_DEVICE_TYPE_ACCELERATOR;
else if( strcmp( str, "CL_DEVICE_TYPE_DEFAULT" ) == 0 )
else if( strcmp( argv[i], "CL_DEVICE_TYPE_DEFAULT" ) == 0 )
gDeviceType = CL_DEVICE_TYPE_DEFAULT;
else if( strcmp( str, "debug_trace" ) == 0 )
else if( strcmp( argv[i], "debug_trace" ) == 0 )
gDebugTrace = true;
else if( strcmp( str, "small_images" ) == 0 )
else if( strcmp( argv[i], "small_images" ) == 0 )
gTestSmallImages = true;
else if( strcmp( str, "max_images" ) == 0 )
else if( strcmp( argv[i], "max_images" ) == 0 )
gTestMaxImages = true;
else if( strcmp( str, "use_pitches" ) == 0 )
else if( strcmp( argv[i], "use_pitches" ) == 0 )
gEnablePitch = true;
else if( strcmp( str, "use_ramps" ) == 0 )
else if( strcmp( argv[i], "use_ramps" ) == 0 )
gUseRamp = true;
else if( strcmp(str, "test_mipmaps") == 0 ) {
else if( strcmp( argv[i], "test_mipmaps") == 0 ) {
gTestMipmaps = true;
// Don't test pitches with mipmaps right now.
gEnablePitch = false;
}
else if( strcmp( str, "randomize" ) == 0 )
else if( strcmp( argv[i], "randomize" ) == 0 )
randomize = true;
else if( strcmp( str, "1D" ) == 0 )
testMethods |= k1D;
else if( strcmp( str, "2D" ) == 0 )
testMethods |= k2D;
else if( strcmp( str, "3D" ) == 0 )
testMethods |= k3D;
else if( strcmp( str, "1Darray" ) == 0 )
testMethods |= k1DArray;
else if( strcmp( str, "2Darray" ) == 0 )
testMethods |= k2DArray;
else if( strcmp( str, "help" ) == 0 || strcmp( str, "?" ) == 0 )
else if( strcmp( argv[i], "--help" ) == 0 || strcmp( argv[i], "-h" ) == 0 )
{
printUsage( argv[ 0 ] );
return -1;
}
else if( ( chanType = get_channel_type_from_name( str ) ) != (cl_channel_type)-1 )
else if( ( chanType = get_channel_type_from_name( argv[i] ) ) != (cl_channel_type)-1 )
gChannelTypeToUse = chanType;
else
{
log_error( "ERROR: Unknown argument %d: %s. Exiting....\n", i, str );
return -1;
else
{
argList[argCount] = argv[i];
argCount++;
}
}
}
if (testMethods == 0)
testMethods = k1D | k2D | k3D | k1DArray | k2DArray;
// Seed the random # generators
if( randomize )
@@ -224,18 +226,7 @@ int main(int argc, const char *argv[])
if( gTestSmallImages )
log_info( "Note: Using small test images\n" );
// Run the test now
int ret = 0;
if (testMethods & k1D)
ret += test_image_set( device, CL_MEM_OBJECT_IMAGE1D );
if (testMethods & k2D)
ret += test_image_set( device, CL_MEM_OBJECT_IMAGE2D );
if (testMethods & k3D)
ret += test_image_set( device, CL_MEM_OBJECT_IMAGE3D );
if (testMethods & k1DArray)
ret += test_image_set( device, CL_MEM_OBJECT_IMAGE1D_ARRAY );
if (testMethods & k2DArray)
ret += test_image_set( device, CL_MEM_OBJECT_IMAGE2D_ARRAY );
int ret = parseAndCallCommandLineTests( argCount, argList, NULL, test_num, test_list, true, 0, 0 );
error = clFinish(queue);
if (error)
@@ -243,23 +234,44 @@ int main(int argc, const char *argv[])
if (gTestFailure == 0) {
if (gTestCount > 1)
log_info("PASSED %d of %d tests.\n", gTestCount, gTestCount);
log_info("PASSED %d of %d sub-tests.\n", gTestCount, gTestCount);
else
log_info("PASSED test.\n");
log_info("PASSED sub-test.\n");
} else if (gTestFailure > 0) {
if (gTestCount > 1)
log_error("FAILED %d of %d tests.\n", gTestFailure, gTestCount);
log_error("FAILED %d of %d sub-tests.\n", gTestFailure, gTestCount);
else
log_error("FAILED test.\n");
log_error("FAILED sub-test.\n");
}
// Clean up
clReleaseCommandQueue(queue);
clReleaseContext(context);
free(argList);
test_finish();
if (gTestFailure > 0)
return gTestFailure;
return ret;
}
static void printUsage( const char *execName )
{
const char *p = strrchr( execName, '/' );
if( p != NULL )
execName = p + 1;
log_info( "Usage: %s [options] [test_names]\n", execName );
log_info( "Options:\n" );
log_info( "\tdebug_trace - Enables additional debug info logging\n" );
log_info( "\tsmall_images - Runs every format through a loop of widths 1-13 and heights 1-9, instead of random sizes\n" );
log_info( "\tmax_images - Runs every format through a set of size combinations with the max values, max values - 1, and max values / 128\n" );
log_info( "\tuse_pitches - Enables row and slice pitches\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( "\ttest_mipmaps - Test mipmapped images\n" );
log_info( "\trandomize - Uses random seed\n" );
log_info( "\n" );
log_info( "Test names:\n" );
for( int i = 0; i < test_num; i++ )
{
log_info( "\t%s\n", test_list[i].name );
}
}

View File

@@ -30,41 +30,52 @@ bool gDebugTrace = false, gTestSmallImages = false, gTestMaxImages =
int gTypesToTest = 0;
cl_channel_type gChannelTypeToUse = (cl_channel_type)-1;
cl_device_type gDeviceType = CL_DEVICE_TYPE_DEFAULT;
static cl_device_id device;
extern int test_image_set( cl_device_id device, cl_mem_object_type imageType );
static void printUsage( const char *execName );
#define MAX_ALLOWED_STD_DEVIATION_IN_MB 8.0
clCommandQueueWrapper queue;
clContextWrapper context;
void printUsage( const char *execName )
int test_1D(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
const char *p = strrchr( execName, '/' );
if( p != NULL )
execName = p + 1;
log_info( "Usage: %s [debug_trace] [small_images]\n", execName );
log_info( "Where:\n" );
log_info( "\t1D - Only test 1D images\n" );
log_info( "\t2D - Only test 2D images\n" );
log_info( "\t3D - Only test 3D images\n" );
log_info( "\t1Darray - Only test 1D image arrays\n" );
log_info( "\t2Darray - Only test 2D image arrays\n" );
log_info( "\n" );
log_info( "\tdebug_trace - Enables additional debug info logging\n" );
log_info( "\tsmall_images - Runs every format through a loop of widths 1-13 and heights 1-9, instead of random sizes\n" );
log_info( "\tmax_images - Runs every format through a set of size combinations with the max values, max values - 1, and max values / 128\n" );
return test_image_set( device, CL_MEM_OBJECT_IMAGE1D );
}
int test_2D(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
return test_image_set( device, CL_MEM_OBJECT_IMAGE2D );
}
int test_3D(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
return test_image_set( device, CL_MEM_OBJECT_IMAGE3D );
}
int test_1Darray(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
return test_image_set( device, CL_MEM_OBJECT_IMAGE1D_ARRAY );
}
int test_2Darray(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
return test_image_set( device, CL_MEM_OBJECT_IMAGE2D_ARRAY );
}
test_definition test_list[] = {
ADD_TEST( 1D ),
ADD_TEST( 2D ),
ADD_TEST( 3D ),
ADD_TEST( 1Darray ),
ADD_TEST( 2Darray ),
};
const int test_num = ARRAY_SIZE( test_list );
int main(int argc, const char *argv[])
{
cl_platform_id platform;
cl_device_id device;
cl_channel_type chanType;
char str[ 128 ];
int testMethods = 0;
bool randomize = false;
test_start();
@@ -78,58 +89,53 @@ int main(int argc, const char *argv[])
checkDeviceTypeOverride( &gDeviceType );
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;
// Parse arguments
for( int i = 1; i < argc; i++ )
{
strncpy( str, argv[ i ], sizeof( str ) - 1 );
if( strcmp( str, "cpu" ) == 0 || strcmp( str, "CL_DEVICE_TYPE_CPU" ) == 0 )
if( strcmp( argv[i], "cpu" ) == 0 || strcmp( argv[i], "CL_DEVICE_TYPE_CPU" ) == 0 )
gDeviceType = CL_DEVICE_TYPE_CPU;
else if( strcmp( str, "gpu" ) == 0 || strcmp( str, "CL_DEVICE_TYPE_GPU" ) == 0 )
else if( strcmp( argv[i], "gpu" ) == 0 || strcmp( argv[i], "CL_DEVICE_TYPE_GPU" ) == 0 )
gDeviceType = CL_DEVICE_TYPE_GPU;
else if( strcmp( str, "accelerator" ) == 0 || strcmp( str, "CL_DEVICE_TYPE_ACCELERATOR" ) == 0 )
else if( strcmp( argv[i], "accelerator" ) == 0 || strcmp( argv[i], "CL_DEVICE_TYPE_ACCELERATOR" ) == 0 )
gDeviceType = CL_DEVICE_TYPE_ACCELERATOR;
else if( strcmp( str, "CL_DEVICE_TYPE_DEFAULT" ) == 0 )
else if( strcmp( argv[i], "CL_DEVICE_TYPE_DEFAULT" ) == 0 )
gDeviceType = CL_DEVICE_TYPE_DEFAULT;
else if( strcmp( str, "debug_trace" ) == 0 )
else if( strcmp( argv[i], "debug_trace" ) == 0 )
gDebugTrace = true;
else if( strcmp( str, "small_images" ) == 0 )
else if( strcmp( argv[i], "small_images" ) == 0 )
gTestSmallImages = true;
else if( strcmp( str, "max_images" ) == 0 )
else if( strcmp( argv[i], "max_images" ) == 0 )
gTestMaxImages = true;
else if( strcmp( str, "randomize" ) == 0 )
else if( strcmp( argv[i], "randomize" ) == 0 )
randomize = true;
else if ( strcmp( str, "1D" ) == 0 )
testMethods |= k1D;
else if( strcmp( str, "2D" ) == 0 )
testMethods |= k2D;
else if( strcmp( str, "3D" ) == 0 )
testMethods |= k3D;
else if( strcmp( str, "1Darray" ) == 0 )
testMethods |= k1DArray;
else if( strcmp( str, "2Darray" ) == 0 )
testMethods |= k2DArray;
else if( strcmp( str, "help" ) == 0 || strcmp( str, "?" ) == 0 )
else if( strcmp( argv[i], "--help" ) == 0 || strcmp( argv[i], "-h" ) == 0 )
{
printUsage( argv[ 0 ] );
return -1;
}
else if( ( chanType = get_channel_type_from_name( str ) ) != (cl_channel_type)-1 )
else if( ( chanType = get_channel_type_from_name( argv[i] ) ) != (cl_channel_type)-1 )
gChannelTypeToUse = chanType;
else
{
log_error( "ERROR: Unknown argument %d: %s. Exiting....\n", i, str );
return -1;
else
{
argList[argCount] = argv[i];
argCount++;
}
}
}
if (testMethods == 0)
testMethods = k1D | k2D | k3D | k1DArray | k2DArray;
// Seed the random # generators
if( randomize )
@@ -223,18 +229,7 @@ int main(int argc, const char *argv[])
if( gTestSmallImages )
log_info( "Note: Using small test images\n" );
// Run the test now
int ret = 0;
if (testMethods & k1D)
ret += test_image_set( device, CL_MEM_OBJECT_IMAGE1D );
if (testMethods & k2D)
ret += test_image_set( device, CL_MEM_OBJECT_IMAGE2D );
if (testMethods & k3D)
ret += test_image_set( device, CL_MEM_OBJECT_IMAGE3D );
if (testMethods & k1DArray)
ret += test_image_set( device, CL_MEM_OBJECT_IMAGE1D_ARRAY );
if (testMethods & k2DArray)
ret += test_image_set( device, CL_MEM_OBJECT_IMAGE2D_ARRAY );
int ret = parseAndCallCommandLineTests( argCount, argList, NULL, test_num, test_list, true, 0, 0 );
// Clean up
error = clFinish(queue);
@@ -243,20 +238,38 @@ int main(int argc, const char *argv[])
if (gTestFailure == 0) {
if (gTestCount > 1)
log_info("PASSED %d of %d tests.\n", gTestCount, gTestCount);
log_info("PASSED %d of %d sub-tests.\n", gTestCount, gTestCount);
else
log_info("PASSED test.\n");
log_info("PASSED sub-test.\n");
} else if (gTestFailure > 0) {
if (gTestCount > 1)
log_error("FAILED %d of %d tests.\n", gTestFailure, gTestCount);
log_error("FAILED %d of %d sub-tests.\n", gTestFailure, gTestCount);
else
log_error("FAILED test.\n");
log_error("FAILED sub-test.\n");
}
free(argList);
test_finish();
if (gTestFailure > 0)
return gTestFailure;
return ret;
}
static void printUsage( const char *execName )
{
const char *p = strrchr( execName, '/' );
if( p != NULL )
execName = p + 1;
log_info( "Usage: %s [options] [test_names]\n", execName );
log_info( "Options:\n" );
log_info( "\tdebug_trace - Enables additional debug info logging\n" );
log_info( "\tsmall_images - Runs every format through a loop of widths 1-13 and heights 1-9, instead of random sizes\n" );
log_info( "\tmax_images - Runs every format through a set of size combinations with the max values, max values - 1, and max values / 128\n" );
log_info( "\trandomize - Uses random seed\n" );
log_info( "\n" );
log_info( "Test names:\n" );
for( int i = 0; i < test_num; i++ )
{
log_info( "\t%s\n", test_list[i].name );
}
}

View File

@@ -248,26 +248,15 @@ int test_2Darray(cl_device_id deviceID, cl_context context, cl_command_queue que
return doTest( CL_MEM_OBJECT_IMAGE2D_ARRAY );
}
basefn basefn_list[] = {
test_1D,
test_2D,
test_3D,
test_1Darray,
test_2Darray,
test_definition test_list[] = {
ADD_TEST( 1D ),
ADD_TEST( 2D ),
ADD_TEST( 3D ),
ADD_TEST( 1Darray ),
ADD_TEST( 2Darray ),
};
const char *basefn_names[] = {
"1D",
"2D",
"3D",
"1Darray",
"2Darray",
};
ct_assert((sizeof(basefn_names) / sizeof(basefn_names[0])) == (sizeof(basefn_list) / sizeof(basefn_list[0])));
int num_fns = sizeof(basefn_names) / sizeof(char *);
const int test_num = ARRAY_SIZE( test_list );
int main(int argc, const char *argv[])
{
@@ -539,7 +528,7 @@ int main(int argc, const char *argv[])
FPU_mode_type oldMode;
DisableFTZ(&oldMode);
int ret = parseAndCallCommandLineTests( argCount, argList, NULL, num_fns, basefn_list, basefn_names, true, 0, 0 );
int ret = parseAndCallCommandLineTests( argCount, argList, NULL, test_num, test_list, true, 0, 0 );
// Restore FP state before leaving
RestoreFPState(&oldMode);
@@ -621,8 +610,8 @@ static void printUsage( const char *execName )
log_info( "\ttest_mipmaps - Enables mipmapped images\n");
log_info( "\n" );
log_info( "Test names:\n" );
for( int i = 0; i < num_fns; i++ )
for( int i = 0; i < test_num; i++ )
{
log_info( "\t%s\n", basefn_names[i] );
log_info( "\t%s\n", test_list[i].name );
}
}

View File

@@ -45,51 +45,51 @@ cl_device_type gDeviceType = CL_DEVICE_TYPE_DEFAULT;
cl_command_queue queue;
cl_context context;
static cl_device_id device;
#define MAX_ALLOWED_STD_DEVIATION_IN_MB 8.0
void printUsage( const char *execName )
{
const char *p = strrchr( execName, '/' );
if ( p != NULL )
execName = p + 1;
log_info( "Usage: %s [options]\n", execName );
log_info( "Where:\n" );
log_info( "\n" );
log_info( "\tThe following flags specify the types to test. They can be combined; if none are specified, all are tested:\n" );
log_info( "\t\tint - Test integer I/O (read_imagei)\n" );
log_info( "\t\tuint - Test unsigned integer I/O (read_imageui)\n" );
log_info( "\t\tfloat - Test float I/O (read_imagef)\n" );
log_info( "\n" );
log_info( "You may also use appropriate CL_ channel type and ordering constants.\n" );
log_info( "\n" );
log_info( "\t1D - Only test 1D images\n" );
log_info( "\t2D - Only test 2D images\n" );
log_info( "\t3D - Only test 3D images\n" );
log_info( "\t1Darray - Only test 1D image arrays\n" );
log_info( "\t2Darray - Only test 2D image arrays\n" );
log_info( "\n" );
log_info( "\tThe following modify the types of images tested:\n" );
log_info( "\t\read_write - Runs the tests with read_write images which allow a kernel do both read and write to the same image \n" );
log_info( "\t\tsmall_images - Runs every format through a loop of widths 1-13 and heights 1-9, instead of random sizes\n" );
log_info( "\t\tmax_images - Runs every format through a set of size combinations with the max values, max values - 1, and max values / 128\n" );
log_info( "\n" );
log_info( "\tdebug_trace - Enables additional debug info logging\n" );
log_info( "\tuse_pitches - Enables row and slice pitches\n" );
}
static void printUsage( const char *execName );
extern int test_image_set( cl_device_id device, cl_mem_object_type imageType );
int test_1D(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
return test_image_set( device, CL_MEM_OBJECT_IMAGE1D ) +
test_image_set( device, CL_MEM_OBJECT_IMAGE1D_BUFFER );
}
int test_2D(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
return test_image_set( device, CL_MEM_OBJECT_IMAGE2D );
}
int test_3D(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
return test_image_set( device, CL_MEM_OBJECT_IMAGE3D );
}
int test_1Darray(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
return test_image_set( device, CL_MEM_OBJECT_IMAGE1D_ARRAY );
}
int test_2Darray(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
{
return test_image_set( device, CL_MEM_OBJECT_IMAGE2D_ARRAY );
}
test_definition test_list[] = {
ADD_TEST( 1D ),
ADD_TEST( 2D ),
ADD_TEST( 3D ),
ADD_TEST( 1Darray ),
ADD_TEST( 2Darray ),
};
const int test_num = ARRAY_SIZE( test_list );
int main(int argc, const char *argv[])
{
cl_platform_id platform;
cl_device_id device;
cl_channel_type chanType;
cl_channel_order chanOrder;
char str[ 128 ];
int testMethods = 0;
bool randomize = false;
test_start();
@@ -104,72 +104,68 @@ int main(int argc, const char *argv[])
//Check CL_DEVICE_TYPE environment variable
checkDeviceTypeOverride( &gDeviceType );
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;
// Parse arguments
for ( int i = 1; i < argc; i++ )
{
strncpy( str, argv[ i ], sizeof( str ) - 1 );
if ( strcmp( str, "cpu" ) == 0 || strcmp( str, "CL_DEVICE_TYPE_CPU" ) == 0 )
if ( strcmp( argv[i], "cpu" ) == 0 || strcmp( argv[i], "CL_DEVICE_TYPE_CPU" ) == 0 )
gDeviceType = CL_DEVICE_TYPE_CPU;
else if ( strcmp( str, "gpu" ) == 0 || strcmp( str, "CL_DEVICE_TYPE_GPU" ) == 0 )
else if ( strcmp( argv[i], "gpu" ) == 0 || strcmp( argv[i], "CL_DEVICE_TYPE_GPU" ) == 0 )
gDeviceType = CL_DEVICE_TYPE_GPU;
else if ( strcmp( str, "accelerator" ) == 0 || strcmp( str, "CL_DEVICE_TYPE_ACCELERATOR" ) == 0 )
else if ( strcmp( argv[i], "accelerator" ) == 0 || strcmp( argv[i], "CL_DEVICE_TYPE_ACCELERATOR" ) == 0 )
gDeviceType = CL_DEVICE_TYPE_ACCELERATOR;
else if ( strcmp( str, "CL_DEVICE_TYPE_DEFAULT" ) == 0 )
else if ( strcmp( argv[i], "CL_DEVICE_TYPE_DEFAULT" ) == 0 )
gDeviceType = CL_DEVICE_TYPE_DEFAULT;
else if ( strcmp( str, "debug_trace" ) == 0 )
else if ( strcmp( argv[i], "debug_trace" ) == 0 )
gDebugTrace = true;
else if ( strcmp( str, "read_write" ) == 0 )
else if ( strcmp( argv[i], "read_write" ) == 0 )
gTestReadWrite = true;
else if ( strcmp( str, "small_images" ) == 0 )
else if ( strcmp( argv[i], "small_images" ) == 0 )
gTestSmallImages = true;
else if ( strcmp( str, "max_images" ) == 0 )
else if ( strcmp( argv[i], "max_images" ) == 0 )
gTestMaxImages = true;
else if ( strcmp( str, "use_pitches" ) == 0 )
else if ( strcmp( argv[i], "use_pitches" ) == 0 )
gEnablePitch = true;
else if ( strcmp( str, "int" ) == 0 )
else if ( strcmp( argv[i], "int" ) == 0 )
gTypesToTest |= kTestInt;
else if ( strcmp( str, "uint" ) == 0 )
else if ( strcmp( argv[i], "uint" ) == 0 )
gTypesToTest |= kTestUInt;
else if ( strcmp( str, "float" ) == 0 )
else if ( strcmp( argv[i], "float" ) == 0 )
gTypesToTest |= kTestFloat;
else if ( strcmp( str, "randomize" ) == 0 )
else if ( strcmp( argv[i], "randomize" ) == 0 )
randomize = true;
else if ( strcmp( str, "1D" ) == 0 )
testMethods |= k1D;
else if( strcmp( str, "2D" ) == 0 )
testMethods |= k2D;
else if( strcmp( str, "3D" ) == 0 )
testMethods |= k3D;
else if( strcmp( str, "1Darray" ) == 0 )
testMethods |= k1DArray;
else if( strcmp( str, "2Darray" ) == 0 )
testMethods |= k2DArray;
else if ( strcmp( str, "help" ) == 0 || strcmp( str, "?" ) == 0 )
else if ( strcmp( argv[i], "--help" ) == 0 || strcmp( argv[i], "-h" ) == 0 )
{
printUsage( argv[ 0 ] );
return -1;
}
else if ( ( chanType = get_channel_type_from_name( str ) ) != (cl_channel_type)-1 )
else if ( ( chanType = get_channel_type_from_name( argv[i] ) ) != (cl_channel_type)-1 )
gChannelTypeToUse = chanType;
else if ( ( chanOrder = get_channel_order_from_name( str ) ) != (cl_channel_order)-1 )
else if ( ( chanOrder = get_channel_order_from_name( argv[i] ) ) != (cl_channel_order)-1 )
gChannelOrderToUse = chanOrder;
else
{
log_error( "ERROR: Unknown argument %d: %s. Exiting....\n", i, str );
return -1;
argList[argCount] = argv[i];
argCount++;
}
}
if (testMethods == 0)
testMethods = k1D | k2D | k3D | k1DArray | k2DArray;
if ( gTypesToTest == 0 )
gTypesToTest = kTestAllTypes;
@@ -255,20 +251,7 @@ int main(int argc, const char *argv[])
FPU_mode_type oldMode;
DisableFTZ(&oldMode);
// Run the test now
int ret = 0;
if (testMethods & k1D) {
ret += test_image_set( device, CL_MEM_OBJECT_IMAGE1D );
ret += test_image_set( device, CL_MEM_OBJECT_IMAGE1D_BUFFER );
}
if (testMethods & k2D)
ret += test_image_set( device, CL_MEM_OBJECT_IMAGE2D );
if (testMethods & k3D)
ret += test_image_set( device, CL_MEM_OBJECT_IMAGE3D );
if (testMethods & k1DArray)
ret += test_image_set( device, CL_MEM_OBJECT_IMAGE1D_ARRAY );
if (testMethods & k2DArray)
ret += test_image_set( device, CL_MEM_OBJECT_IMAGE2D_ARRAY );
int ret = parseAndCallCommandLineTests( argCount, argList, NULL, test_num, test_list, true, 0, 0 );
// Restore FP state before leaving
RestoreFPState(&oldMode);
@@ -282,22 +265,51 @@ int main(int argc, const char *argv[])
if (gTestFailure == 0) {
if (gTestCount > 1)
log_info("PASSED %d of %d tests.\n", gTestCount, gTestCount);
log_info("PASSED %d of %d sub-tests.\n", gTestCount, gTestCount);
else
log_info("PASSED test.\n");
log_info("PASSED sub-test.\n");
}
else if (gTestFailure > 0) {
if (gTestCount > 1)
log_error("FAILED %d of %d tests.\n", gTestFailure, gTestCount);
log_error("FAILED %d of %d sub-tests.\n", gTestFailure, gTestCount);
else
log_error("FAILED test.\n");
log_error("FAILED sub-test.\n");
}
// Clean up
free(argList);
test_finish();
if (gTestFailure > 0)
return gTestFailure;
return ret;
}
static void printUsage( const char *execName )
{
const char *p = strrchr( execName, '/' );
if ( p != NULL )
execName = p + 1;
log_info( "Usage: %s [options] [test_names]\n", execName );
log_info( "Options:\n" );
log_info( "\n" );
log_info( "\tThe following flags specify the types to test. They can be combined; if none are specified, all are tested:\n" );
log_info( "\t\tint - Test integer I/O (read_imagei)\n" );
log_info( "\t\tuint - Test unsigned integer I/O (read_imageui)\n" );
log_info( "\t\tfloat - Test float I/O (read_imagef)\n" );
log_info( "\n" );
log_info( "You may also use appropriate CL_ channel type and ordering constants.\n" );
log_info( "\n" );
log_info( "\tThe following modify the types of images tested:\n" );
log_info( "\t\read_write - Runs the tests with read_write images which allow a kernel do both read and write to the same image \n" );
log_info( "\t\tsmall_images - Runs every format through a loop of widths 1-13 and heights 1-9, instead of random sizes\n" );
log_info( "\t\tmax_images - Runs every format through a set of size combinations with the max values, max values - 1, and max values / 128\n" );
log_info( "\n" );
log_info( "\tdebug_trace - Enables additional debug info logging\n" );
log_info( "\tuse_pitches - Enables row and slice pitches\n" );
log_info( "\n" );
log_info( "Test names:\n" );
for( int i = 0; i < test_num; i++ )
{
log_info( "\t%s\n", test_list[i].name );
}
}

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