mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-20 06:29:02 +00:00
Remove unnecessary cl_mem_flags casts (#1018)
* api, atomics: remove unnecessary cl_mem_flags casts Instances in api, atomics, buffers and c11_atomics suites Contributes #759 Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com> * basic: remove unnecessary cl_mem_flags casts Contributes #759 Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com> * spir, thread_dimensions: remove unnecessary cl_mem_flags casts Instances in spir, thread_dimensions and workgroups tests Contributes #759 Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com> * profiling, relationals: remove unnecessary cl_mem_flags casts Includes relationals, profiling, muliple_device_context, integer_ops tests Contributes #759 Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com> * clcpp: remove unnecessary cl_mem_flags casts Contibutes #759 Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com> * events, geometrics: remove unnecessary cl_mem_flags casts Includes events, geometrics, gl and images tests Contributes #759 Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com> * commonfs, compiler: remove unnecessary cl_mem_flags casts Includes cast removal in commonfs, compiler and device_partition tests Fixes #759 Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com> * Fix up formatting Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
This commit is contained in:
@@ -107,12 +107,14 @@ static int copy_size( cl_device_id device, cl_context context, cl_command_queue
|
||||
int_input_ptr = (cl_int*)malloc(sizeof(cl_int) * num_elements);
|
||||
int_output_ptr = (cl_int*)malloc(sizeof(cl_int) * num_elements);
|
||||
|
||||
streams[0] = clCreateBuffer( context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(cl_int) * num_elements, NULL, &err );
|
||||
streams[0] = clCreateBuffer(context, CL_MEM_READ_WRITE,
|
||||
sizeof(cl_int) * num_elements, NULL, &err);
|
||||
if( !streams[0] ){
|
||||
log_error("clCreateBuffer failed\n");
|
||||
return -1;
|
||||
}
|
||||
streams[1] = clCreateBuffer( context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(cl_int) * num_elements, NULL, &err );
|
||||
streams[1] = clCreateBuffer(context, CL_MEM_READ_WRITE,
|
||||
sizeof(cl_int) * num_elements, NULL, &err);
|
||||
if( !streams[1] ){
|
||||
log_error("clCreateBuffer failed\n");
|
||||
return -1;
|
||||
@@ -250,13 +252,15 @@ static int copy_partial_size( cl_device_id device, cl_context context, cl_comman
|
||||
inptr = (cl_int *)malloc(sizeof(cl_int) * num_elements);
|
||||
outptr = (cl_int *)malloc(sizeof(cl_int) * num_elements);
|
||||
|
||||
streams[0] = clCreateBuffer( context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(cl_int) * num_elements, NULL, &err );
|
||||
streams[0] = clCreateBuffer(context, CL_MEM_READ_WRITE,
|
||||
sizeof(cl_int) * num_elements, NULL, &err);
|
||||
if (!streams[0])
|
||||
{
|
||||
log_error("clCreateBuffer failed\n");
|
||||
return -1;
|
||||
}
|
||||
streams[1] = clCreateBuffer( context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(cl_int) * num_elements, NULL, &err );
|
||||
streams[1] = clCreateBuffer(context, CL_MEM_READ_WRITE,
|
||||
sizeof(cl_int) * num_elements, NULL, &err);
|
||||
if (!streams[1])
|
||||
{
|
||||
log_error("clCreateBuffer failed\n");
|
||||
@@ -467,7 +471,7 @@ static int copy_image_size( cl_device_id device, cl_context context,
|
||||
}
|
||||
|
||||
// allocate the input image
|
||||
flags = (cl_mem_flags)(CL_MEM_READ_WRITE);
|
||||
flags = CL_MEM_READ_WRITE;
|
||||
memobjs[0] = create_image_2d(context, flags, &image_format_desc, w, h, 0, NULL, &err);
|
||||
if( memobjs[0] == (cl_mem)0 ) {
|
||||
free( dst );
|
||||
@@ -476,7 +480,8 @@ static int copy_image_size( cl_device_id device, cl_context context,
|
||||
return -1;
|
||||
}
|
||||
|
||||
memobjs[1] = clCreateBuffer( context, (cl_mem_flags)(CL_MEM_READ_WRITE), num_bytes, NULL, &err );
|
||||
memobjs[1] =
|
||||
clCreateBuffer(context, CL_MEM_READ_WRITE, num_bytes, NULL, &err);
|
||||
if( memobjs[1] == (cl_mem)0 ) {
|
||||
clReleaseMemObject(memobjs[0]);
|
||||
free( dst );
|
||||
@@ -784,7 +789,7 @@ int test_copy_array_to_image( cl_device_id device, cl_context context, cl_comman
|
||||
}
|
||||
|
||||
// allocate the input image
|
||||
flags = (cl_mem_flags)(CL_MEM_READ_WRITE);
|
||||
flags = CL_MEM_READ_WRITE;
|
||||
memobjs[0] = create_image_2d( context, flags, &image_format_desc, w, h, 0, NULL, &err );
|
||||
if( memobjs[0] == (cl_mem)0 ){
|
||||
free( dst );
|
||||
@@ -793,7 +798,9 @@ int test_copy_array_to_image( cl_device_id device, cl_context context, cl_comman
|
||||
return -1;
|
||||
}
|
||||
|
||||
memobjs[1] = clCreateBuffer( context, (cl_mem_flags)(CL_MEM_READ_WRITE), channel_nbytes * num_channels*w*h, NULL, &err );
|
||||
memobjs[1] =
|
||||
clCreateBuffer(context, CL_MEM_READ_WRITE,
|
||||
channel_nbytes * num_channels * w * h, NULL, &err);
|
||||
if( memobjs[1] == (cl_mem)0 ) {
|
||||
clReleaseMemObject( memobjs[0] );
|
||||
free( dst );
|
||||
|
||||
Reference in New Issue
Block a user