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:
@@ -128,7 +128,9 @@ int test_ctors_execution(cl_device_id device,
|
||||
|
||||
// host vector, size == count, output[0...count-1] == 1
|
||||
std::vector<cl_uint> output(count, cl_uint(1));
|
||||
output_buffer = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(cl_uint) * output.size(), NULL, &error);
|
||||
output_buffer =
|
||||
clCreateBuffer(context, CL_MEM_READ_WRITE,
|
||||
sizeof(cl_uint) * output.size(), NULL, &error);
|
||||
RETURN_ON_CL_ERROR(error, "clCreateBuffer")
|
||||
|
||||
error = clEnqueueWriteBuffer(queue, output_buffer, CL_TRUE, 0, sizeof(cl_uint) * output.size(), static_cast<void *>(output.data()), 0, NULL, NULL);
|
||||
@@ -298,7 +300,9 @@ AUTO_TEST_CASE(test_global_scope_ctors_executed_once)
|
||||
|
||||
// host vector, size == count, output[0...count-1] == 1
|
||||
std::vector<cl_uint> output(count, cl_uint(1));
|
||||
output_buffer = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(cl_uint) * output.size(), NULL, &error);
|
||||
output_buffer =
|
||||
clCreateBuffer(context, CL_MEM_READ_WRITE,
|
||||
sizeof(cl_uint) * output.size(), NULL, &error);
|
||||
RETURN_ON_CL_ERROR(error, "clCreateBuffer")
|
||||
|
||||
for(size_t i = 0; i < 4; i++)
|
||||
@@ -435,7 +439,9 @@ AUTO_TEST_CASE(test_global_scope_ctors_ndrange)
|
||||
|
||||
// host vector, size == count, output[0...count-1] == 1
|
||||
std::vector<cl_uint> output(count, cl_uint(1));
|
||||
output_buffer = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(cl_uint) * output.size(), NULL, &error);
|
||||
output_buffer =
|
||||
clCreateBuffer(context, CL_MEM_READ_WRITE,
|
||||
sizeof(cl_uint) * output.size(), NULL, &error);
|
||||
RETURN_ON_CL_ERROR(error, "clCreateBuffer")
|
||||
|
||||
error = clEnqueueWriteBuffer(
|
||||
|
||||
@@ -114,7 +114,9 @@ AUTO_TEST_CASE(test_global_scope_dtor_is_executed)
|
||||
// host vector, size == count, output[0...count-1] == 0xbeefbeef (3203383023)
|
||||
// values in output __MUST BE__ greater than 0 for the test to work correctly
|
||||
std::vector<cl_uint> output(count, cl_uint(0xbeefbeef));
|
||||
output_buffer = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(cl_uint) * output.size(), NULL, &error);
|
||||
output_buffer =
|
||||
clCreateBuffer(context, CL_MEM_READ_WRITE,
|
||||
sizeof(cl_uint) * output.size(), NULL, &error);
|
||||
RETURN_ON_CL_ERROR(error, "clCreateBuffer")
|
||||
|
||||
error = clEnqueueWriteBuffer(
|
||||
@@ -297,7 +299,9 @@ AUTO_TEST_CASE(test_global_scope_dtors_executed_once)
|
||||
// values in output __MUST BE__ greater than 0 for the test to work correctly
|
||||
cl_uint init_value = cl_uint(0xbeefbeef);
|
||||
std::vector<cl_uint> output(count, init_value);
|
||||
output_buffer = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(cl_uint) * output.size(), NULL, &error);
|
||||
output_buffer =
|
||||
clCreateBuffer(context, CL_MEM_READ_WRITE,
|
||||
sizeof(cl_uint) * output.size(), NULL, &error);
|
||||
RETURN_ON_CL_ERROR(error, "clCreateBuffer")
|
||||
|
||||
error = clEnqueueWriteBuffer(
|
||||
@@ -497,7 +501,9 @@ AUTO_TEST_CASE(test_global_scope_dtor_ndrange)
|
||||
// host vector, size == count, output[0...count-1] == 0xbeefbeef (3203383023)
|
||||
// values in output __MUST BE__ greater than 0 for the test to work correctly
|
||||
std::vector<cl_uint> output(count, cl_uint(0xbeefbeef));
|
||||
output_buffer = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(cl_uint) * output.size(), NULL, &error);
|
||||
output_buffer =
|
||||
clCreateBuffer(context, CL_MEM_READ_WRITE,
|
||||
sizeof(cl_uint) * output.size(), NULL, &error);
|
||||
RETURN_ON_CL_ERROR(error, "clCreateBuffer")
|
||||
|
||||
error = clEnqueueWriteBuffer(
|
||||
|
||||
@@ -124,7 +124,9 @@ AUTO_TEST_CASE(test_spec_consts_defaults)
|
||||
|
||||
// host vector, size == 1, output[0] == 1
|
||||
std::vector<cl_int> output(1, cl_int(1));
|
||||
output_buffer = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(cl_int) * output.size(), NULL, &error);
|
||||
output_buffer =
|
||||
clCreateBuffer(context, CL_MEM_READ_WRITE,
|
||||
sizeof(cl_int) * output.size(), NULL, &error);
|
||||
RETURN_ON_CL_ERROR(error, "clCreateBuffer")
|
||||
|
||||
error = clEnqueueWriteBuffer(queue, output_buffer, CL_TRUE, 0, sizeof(cl_int) * output.size(), static_cast<void *>(output.data()), 0, NULL, NULL);
|
||||
@@ -248,7 +250,9 @@ AUTO_TEST_CASE(test_spec_consts_many_constants)
|
||||
|
||||
// host vector, size == 1, output[0] == 1
|
||||
std::vector<cl_int> output(1, cl_int(1));
|
||||
output_buffer = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(cl_int) * output.size(), NULL, &error);
|
||||
output_buffer =
|
||||
clCreateBuffer(context, CL_MEM_READ_WRITE,
|
||||
sizeof(cl_int) * output.size(), NULL, &error);
|
||||
RETURN_ON_CL_ERROR(error, "clCreateBuffer")
|
||||
|
||||
error = clEnqueueWriteBuffer(queue, output_buffer, CL_TRUE, 0, sizeof(cl_int) * output.size(), static_cast<void *>(output.data()), 0, NULL, NULL);
|
||||
@@ -443,7 +447,9 @@ AUTO_TEST_CASE(test_spec_consts_different_types)
|
||||
|
||||
// host vector, size == 1, output[0] == 1
|
||||
std::vector<cl_int> output(1, cl_int(1));
|
||||
output_buffer = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(cl_int) * output.size(), NULL, &error);
|
||||
output_buffer =
|
||||
clCreateBuffer(context, CL_MEM_READ_WRITE,
|
||||
sizeof(cl_int) * output.size(), NULL, &error);
|
||||
RETURN_ON_CL_ERROR(error, "clCreateBuffer")
|
||||
|
||||
error = clEnqueueWriteBuffer(queue, output_buffer, CL_TRUE, 0, sizeof(cl_int) * output.size(), static_cast<void *>(output.data()), 0, NULL, NULL);
|
||||
|
||||
Reference in New Issue
Block a user