mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
Remove most remaining clCreate*WithProperties calls in tests that run on 1.2
Don't touch interop suites or code only run with options not required for conformance. Signed-off-by: Kevin Petit <kevin.petit@arm.com>
This commit is contained in:
@@ -19,7 +19,7 @@ cl_command_queue reset_queue(cl_context context, cl_device_id device_id, cl_comm
|
||||
{
|
||||
log_info("Invalid command queue. Releasing and recreating the command queue.\n");
|
||||
clReleaseCommandQueue(*queue);
|
||||
*queue = clCreateCommandQueueWithProperties(context, device_id, 0, error);
|
||||
*queue = clCreateCommandQueue(context, device_id, 0, error);
|
||||
return *queue;
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ int test_create_context_from_type(cl_device_id deviceID, cl_context context, cl_
|
||||
return -1;
|
||||
}
|
||||
|
||||
queue_to_test = clCreateCommandQueueWithProperties(context_to_test, deviceID, NULL, &error);
|
||||
queue_to_test = clCreateCommandQueue(context_to_test, deviceID, NULL, &error);
|
||||
test_error(error, "clCreateCommandQueue failed");
|
||||
if (queue_to_test == NULL) {
|
||||
log_error("clCreateCommandQueue returned NULL, but error was CL_SUCCESS.");
|
||||
|
||||
@@ -521,7 +521,7 @@ int test_repeated_setup_cleanup(cl_device_id deviceID, cl_context context, cl_co
|
||||
local_context = clCreateContext(NULL, 1, &deviceID, notify_callback, NULL, &error);
|
||||
test_error( error, "clCreateContext failed");
|
||||
|
||||
local_queue = clCreateCommandQueueWithProperties(local_context, deviceID, 0, &error);
|
||||
local_queue = clCreateCommandQueue(local_context, deviceID, 0, &error);
|
||||
test_error( error, "clCreateCommandQueue failed");
|
||||
|
||||
error = create_single_kernel_helper(local_context, &local_program, NULL, 1, &repeate_test_kernel, NULL);
|
||||
|
||||
@@ -38,7 +38,7 @@ int test_retain_queue_single(cl_device_id deviceID, cl_context context, cl_comma
|
||||
|
||||
|
||||
/* Create a test queue */
|
||||
queue = clCreateCommandQueueWithProperties( context, deviceID, 0, &err );
|
||||
queue = clCreateCommandQueue( context, deviceID, 0, &err );
|
||||
test_error( err, "Unable to create command queue to test with" );
|
||||
|
||||
/* Test the instance count */
|
||||
@@ -70,7 +70,7 @@ int test_retain_queue_multiple(cl_device_id deviceID, cl_context context, cl_com
|
||||
|
||||
|
||||
/* Create a test program */
|
||||
queue = clCreateCommandQueueWithProperties( context, deviceID, 0, &err );
|
||||
queue = clCreateCommandQueue( context, deviceID, 0, &err );
|
||||
test_error( err, "Unable to create command queue to test with" );
|
||||
|
||||
/* Increment 9 times, which should bring the count to 10 */
|
||||
|
||||
@@ -209,13 +209,8 @@ int test_readimage(cl_device_id device, cl_context context, cl_command_queue que
|
||||
if (err)
|
||||
return -1;
|
||||
|
||||
cl_sampler_properties properties[] = {
|
||||
CL_SAMPLER_NORMALIZED_COORDS, CL_FALSE,
|
||||
CL_SAMPLER_ADDRESSING_MODE, CL_ADDRESS_CLAMP_TO_EDGE,
|
||||
CL_SAMPLER_FILTER_MODE, CL_FILTER_NEAREST,
|
||||
0 };
|
||||
cl_sampler sampler = clCreateSamplerWithProperties(context, properties, &err);
|
||||
test_error(err, "clCreateSamplerWithProperties failed");
|
||||
cl_sampler sampler = clCreateSampler(context, CL_FALSE, CL_ADDRESS_CLAMP_TO_EDGE, CL_FILTER_NEAREST, &err);
|
||||
test_error(err, "clCreateSampler failed");
|
||||
|
||||
if(supportsBGRA)
|
||||
{
|
||||
|
||||
@@ -203,7 +203,7 @@ int test_buffer_migrate(cl_device_id deviceID, cl_context context, cl_command_qu
|
||||
// Create a command queue for each sub-device
|
||||
for (i=0; i<num_devices; i++) {
|
||||
if (devices[i]) {
|
||||
if ((queues[i] = clCreateCommandQueueWithProperties(ctx, devices[i], 0, &err)) == NULL) {
|
||||
if ((queues[i] = clCreateCommandQueue(ctx, devices[i], 0, &err)) == NULL) {
|
||||
print_error(err, "Failed creating command queues.");
|
||||
failed = 1;
|
||||
goto cleanup;
|
||||
|
||||
@@ -112,14 +112,6 @@ static cl_int restoreImage(cl_command_queue *queues, cl_mem *mem_objects, cl_uin
|
||||
return CL_SUCCESS;
|
||||
}
|
||||
|
||||
// Declaration moved out of protected scope/goto
|
||||
cl_sampler_properties properties[] = {
|
||||
CL_SAMPLER_NORMALIZED_COORDS, CL_FALSE,
|
||||
CL_SAMPLER_ADDRESSING_MODE, CL_ADDRESS_CLAMP,
|
||||
CL_SAMPLER_FILTER_MODE, CL_FILTER_NEAREST,
|
||||
0
|
||||
};
|
||||
|
||||
int test_image_migrate(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
|
||||
{
|
||||
int failed = 0;
|
||||
@@ -244,7 +236,7 @@ int test_image_migrate(cl_device_id deviceID, cl_context context, cl_command_que
|
||||
// Create a command queue for each sub-device
|
||||
for (i=0; i<num_devices; i++) {
|
||||
if (devices[i]) {
|
||||
if ((queues[i] = clCreateCommandQueueWithProperties(ctx, devices[i], 0, &err)) == NULL) {
|
||||
if ((queues[i] = clCreateCommandQueue(ctx, devices[i], 0, &err)) == NULL) {
|
||||
print_error(err, "Failed creating command queues.");
|
||||
failed = 1;
|
||||
goto cleanup;
|
||||
@@ -266,7 +258,7 @@ int test_image_migrate(cl_device_id deviceID, cl_context context, cl_command_que
|
||||
}
|
||||
|
||||
// Create sampler.
|
||||
sampler = clCreateSamplerWithProperties(ctx, properties, &err );
|
||||
sampler = clCreateSampler(ctx, CL_FALSE, CL_ADDRESS_CLAMP, CL_FILTER_NEAREST, &err );
|
||||
if ((err != CL_SUCCESS) || !sampler) {
|
||||
print_error(err, "Failed to create a sampler.");
|
||||
failed = 1;
|
||||
|
||||
@@ -429,10 +429,10 @@ int test_sub_buffers_read_write_dual_devices( cl_device_id deviceID, cl_context
|
||||
test_error( error, "Unable to create shared context" );
|
||||
|
||||
// Create two queues (can't use the existing one, because it's on the wrong context)
|
||||
clCommandQueueWrapper queue1 = clCreateCommandQueueWithProperties( testingContext, deviceID, 0, &error );
|
||||
clCommandQueueWrapper queue1 = clCreateCommandQueue( testingContext, deviceID, 0, &error );
|
||||
test_error( error, "Unable to create command queue on main device" );
|
||||
|
||||
clCommandQueueWrapper queue2 = clCreateCommandQueueWithProperties( testingContext, otherDevice, 0, &error );
|
||||
clCommandQueueWrapper queue2 = clCreateCommandQueue( testingContext, otherDevice, 0, &error );
|
||||
test_error( error, "Unable to create command queue on secondary device" );
|
||||
|
||||
// Determine the reasonable buffer size and address alignment that applies to BOTH devices
|
||||
|
||||
@@ -116,30 +116,30 @@ int test_event_enqueue_wait_for_events_run_test( cl_device_id deviceID, cl_conte
|
||||
}
|
||||
|
||||
// If we are using two queues then create them
|
||||
cl_queue_properties props[] = {CL_QUEUE_PROPERTIES, CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE, 0};
|
||||
cl_command_queue_properties props = CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE;
|
||||
if (two_queues) {
|
||||
// Get a second queue
|
||||
if (two_devices)
|
||||
{
|
||||
if( !checkDeviceForQueueSupport( two_device_ids[ 0 ], props[1] ) ||
|
||||
!checkDeviceForQueueSupport( two_device_ids[ 1 ], props[1] ) )
|
||||
if( !checkDeviceForQueueSupport( two_device_ids[ 0 ], props ) ||
|
||||
!checkDeviceForQueueSupport( two_device_ids[ 1 ], props ) )
|
||||
{
|
||||
log_info( "WARNING: One or more device for multi-device test does not support out-of-order exec mode; skipping test.\n" );
|
||||
return -1942;
|
||||
}
|
||||
|
||||
queueWrappers[0] = clCreateCommandQueueWithProperties(context_to_use, two_device_ids[0], &props[0], &error);
|
||||
queueWrappers[0] = clCreateCommandQueue(context_to_use, two_device_ids[0], props, &error);
|
||||
test_error(error, "clCreateCommandQueue for first queue on first device failed.");
|
||||
queueWrappers[1] = clCreateCommandQueueWithProperties(context_to_use, two_device_ids[1], &props[0], &error);
|
||||
queueWrappers[1] = clCreateCommandQueue(context_to_use, two_device_ids[1], props, &error);
|
||||
test_error(error, "clCreateCommandQueue for second queue on second device failed.");
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// Single device has already been checked for out-of-order exec support
|
||||
queueWrappers[0] = clCreateCommandQueueWithProperties(context_to_use, deviceID, &props[0], &error);
|
||||
queueWrappers[0] = clCreateCommandQueue(context_to_use, deviceID, props, &error);
|
||||
test_error(error, "clCreateCommandQueue for first queue failed.");
|
||||
queueWrappers[1] = clCreateCommandQueueWithProperties(context_to_use, deviceID, &props[0], &error);
|
||||
queueWrappers[1] = clCreateCommandQueue(context_to_use, deviceID, props, &error);
|
||||
test_error(error, "clCreateCommandQueue for second queue failed.");
|
||||
}
|
||||
// Ugly hack to make sure we only have the wrapper auto-release if they are different queues
|
||||
@@ -151,7 +151,7 @@ int test_event_enqueue_wait_for_events_run_test( cl_device_id deviceID, cl_conte
|
||||
{
|
||||
// (Note: single device has already been checked for out-of-order exec support)
|
||||
// Otherwise create one queue and have the second one be the same
|
||||
queueWrappers[0] = clCreateCommandQueueWithProperties(context_to_use, deviceID, &props[0], &error);
|
||||
queueWrappers[0] = clCreateCommandQueue(context_to_use, deviceID, props, &error);
|
||||
test_error(error, "clCreateCommandQueue for first queue failed.");
|
||||
queues[0] = queueWrappers[0];
|
||||
queues[1] = (cl_command_queue)queues[0];
|
||||
|
||||
@@ -270,15 +270,15 @@ int test_waitlists( cl_device_id deviceID, cl_context context, cl_command_queue
|
||||
{
|
||||
cl_int error;
|
||||
int retVal = 0;
|
||||
cl_queue_properties props[] = {CL_QUEUE_PROPERTIES, CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE, 0};
|
||||
cl_command_queue_properties props = CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE;
|
||||
|
||||
if( !checkDeviceForQueueSupport( deviceID, CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE ) )
|
||||
if( !checkDeviceForQueueSupport( deviceID, props ) )
|
||||
{
|
||||
log_info( "WARNING: Device does not support out-of-order exec mode; skipping test.\n" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
clCommandQueueWrapper queue = clCreateCommandQueueWithProperties( context, deviceID, &props[0], &error );
|
||||
clCommandQueueWrapper queue = clCreateCommandQueue( context, deviceID, props, &error );
|
||||
test_error(error, "Unable to create out-of-order queue");
|
||||
|
||||
log_info( "\n" );
|
||||
|
||||
@@ -141,10 +141,10 @@ test_status InitCL( cl_device_id device )
|
||||
return TEST_FAIL;
|
||||
}
|
||||
|
||||
gQueue = clCreateCommandQueueWithProperties(gContext, device, 0, &error);
|
||||
gQueue = clCreateCommandQueue(gContext, device, 0, &error);
|
||||
if( NULL == gQueue )
|
||||
{
|
||||
vlog_error( "clCreateContext failed. (%d)\n", error );
|
||||
vlog_error( "clCreateCommandQueue failed. (%d)\n", error );
|
||||
return TEST_FAIL;
|
||||
}
|
||||
|
||||
|
||||
@@ -117,12 +117,7 @@ int test_read_image_2D( cl_context context, cl_command_queue queue, cl_kernel ke
|
||||
log_info( " - Creating kernel arguments...\n" );
|
||||
|
||||
// Create sampler to use
|
||||
cl_sampler_properties properties[] = {
|
||||
CL_SAMPLER_NORMALIZED_COORDS, CL_FALSE,
|
||||
CL_SAMPLER_ADDRESSING_MODE, CL_ADDRESS_NONE,
|
||||
CL_SAMPLER_FILTER_MODE, CL_FILTER_NEAREST,
|
||||
0 };
|
||||
actualSampler = clCreateSamplerWithProperties( context, properties, &error );
|
||||
actualSampler = clCreateSampler( context, CL_FALSE, CL_ADDRESS_NONE, CL_FILTER_NEAREST, &error );
|
||||
test_error( error, "Unable to create image sampler" );
|
||||
|
||||
// Create results buffer
|
||||
|
||||
@@ -119,12 +119,7 @@ int test_read_image_1D( cl_context context, cl_command_queue queue, cl_kernel ke
|
||||
log_info( " - Creating kernel arguments...\n" );
|
||||
|
||||
// Create sampler to use
|
||||
cl_sampler_properties properties[] = {
|
||||
CL_SAMPLER_NORMALIZED_COORDS, CL_FALSE,
|
||||
CL_SAMPLER_ADDRESSING_MODE, CL_ADDRESS_NONE,
|
||||
CL_SAMPLER_FILTER_MODE, CL_FILTER_NEAREST,
|
||||
0 };
|
||||
actualSampler = clCreateSamplerWithProperties( context, properties, &error );
|
||||
actualSampler = clCreateSampler( context, CL_FALSE, CL_ADDRESS_NONE, CL_FILTER_NEAREST, &error );
|
||||
test_error( error, "Unable to create image sampler" );
|
||||
|
||||
// Create results buffer
|
||||
|
||||
@@ -114,12 +114,7 @@ int test_read_image_1D_array( cl_context context, cl_command_queue queue, cl_ker
|
||||
log_info( " - Creating kernel arguments...\n" );
|
||||
|
||||
// Create sampler to use
|
||||
cl_sampler_properties properties[] = {
|
||||
CL_SAMPLER_NORMALIZED_COORDS, CL_FALSE,
|
||||
CL_SAMPLER_ADDRESSING_MODE, CL_ADDRESS_NONE,
|
||||
CL_SAMPLER_FILTER_MODE, CL_FILTER_NEAREST,
|
||||
0 };
|
||||
actualSampler = clCreateSamplerWithProperties( context, properties, &error );
|
||||
actualSampler = clCreateSampler( context, CL_FALSE, CL_ADDRESS_NONE, CL_FILTER_NEAREST, &error );
|
||||
test_error( error, "Unable to create image sampler" );
|
||||
|
||||
// Create results buffer
|
||||
|
||||
@@ -108,12 +108,7 @@ int test_read_image_1D_buffer( cl_context context, cl_command_queue queue, cl_ke
|
||||
log_info( " - Creating kernel arguments...\n" );
|
||||
|
||||
// Create sampler to use
|
||||
cl_sampler_properties properties[] = {
|
||||
CL_SAMPLER_NORMALIZED_COORDS, CL_FALSE,
|
||||
CL_SAMPLER_ADDRESSING_MODE, CL_ADDRESS_NONE,
|
||||
CL_SAMPLER_FILTER_MODE, CL_FILTER_NEAREST,
|
||||
0 };
|
||||
actualSampler = clCreateSamplerWithProperties( context, properties, &error );
|
||||
actualSampler = clCreateSampler( context, CL_FALSE, CL_ADDRESS_NONE, CL_FILTER_NEAREST, &error );
|
||||
test_error( error, "Unable to create image sampler" );
|
||||
|
||||
// Create results buffer
|
||||
|
||||
@@ -98,12 +98,7 @@ int test_read_image_2D_array( cl_context context, cl_command_queue queue, cl_ker
|
||||
}
|
||||
|
||||
// Create sampler to use
|
||||
cl_sampler_properties properties[] = {
|
||||
CL_SAMPLER_NORMALIZED_COORDS, CL_FALSE,
|
||||
CL_SAMPLER_ADDRESSING_MODE, CL_ADDRESS_NONE,
|
||||
CL_SAMPLER_FILTER_MODE, CL_FILTER_NEAREST,
|
||||
0 };
|
||||
actualSampler = clCreateSamplerWithProperties( context, properties, &error );
|
||||
actualSampler = clCreateSampler( context, CL_FALSE, CL_ADDRESS_NONE, CL_FILTER_NEAREST, &error );
|
||||
test_error( error, "Unable to create image sampler" );
|
||||
|
||||
// Create results buffer
|
||||
|
||||
@@ -97,12 +97,7 @@ int test_read_image_3D( cl_context context, cl_command_queue queue, cl_kernel ke
|
||||
}
|
||||
|
||||
// Create sampler to use
|
||||
cl_sampler_properties properties[] = {
|
||||
CL_SAMPLER_NORMALIZED_COORDS, CL_FALSE,
|
||||
CL_SAMPLER_ADDRESSING_MODE, CL_ADDRESS_NONE,
|
||||
CL_SAMPLER_FILTER_MODE, CL_FILTER_NEAREST,
|
||||
0 };
|
||||
actualSampler = clCreateSamplerWithProperties( context, properties, &error );
|
||||
actualSampler = clCreateSampler( context, CL_FALSE, CL_ADDRESS_NONE, CL_FILTER_NEAREST, &error );
|
||||
test_error( error, "Unable to create image sampler" );
|
||||
|
||||
// Create results buffer
|
||||
|
||||
@@ -115,14 +115,9 @@ static int run_kernel( cl_device_id device, cl_context context, cl_command_queue
|
||||
if( localThreads[1] > threads[1] )
|
||||
localThreads[1] = threads[1];
|
||||
|
||||
cl_sampler_properties properties[] = {
|
||||
CL_SAMPLER_NORMALIZED_COORDS, CL_FALSE,
|
||||
CL_SAMPLER_ADDRESSING_MODE, CL_ADDRESS_CLAMP_TO_EDGE,
|
||||
CL_SAMPLER_FILTER_MODE, CL_FILTER_NEAREST,
|
||||
0 };
|
||||
cl_sampler sampler = clCreateSamplerWithProperties( context, properties, &err );
|
||||
cl_sampler sampler = clCreateSampler( context, CL_FALSE, CL_ADDRESS_CLAMP_TO_EDGE, CL_FILTER_NEAREST, &err );
|
||||
if( err ){
|
||||
log_error( " clCreateSamplerWithProperties failed.\n" );
|
||||
log_error( " clCreateSampler failed.\n" );
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ void create_context_and_queue(cl_device_id device, cl_context *out_context, cl_c
|
||||
throw Exceptions::TestError("clCreateContext failed\n", error);
|
||||
}
|
||||
|
||||
*out_queue = clCreateCommandQueueWithProperties( *out_context, device, 0, &error );
|
||||
*out_queue = clCreateCommandQueue( *out_context, device, 0, &error );
|
||||
if( NULL == *out_queue || error )
|
||||
{
|
||||
throw Exceptions::TestError("clCreateCommandQueue failed\n", error);
|
||||
|
||||
Reference in New Issue
Block a user