mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +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:
@@ -151,13 +151,17 @@ int test_equiv_kernel_double(cl_context context, cl_command_queue queue, const c
|
||||
generate_equiv_test_data_double( inDataA, vecSize, true, d );
|
||||
generate_equiv_test_data_double( inDataB, vecSize, false, d );
|
||||
|
||||
streams[0] = clCreateBuffer( context, (cl_mem_flags)(CL_MEM_COPY_HOST_PTR), sizeof( cl_double ) * vecSize * TEST_SIZE, &inDataA, &error);
|
||||
streams[0] = clCreateBuffer(context, CL_MEM_COPY_HOST_PTR,
|
||||
sizeof(cl_double) * vecSize * TEST_SIZE,
|
||||
&inDataA, &error);
|
||||
if( streams[0] == NULL )
|
||||
{
|
||||
print_error( error, "Creating input array A failed!\n");
|
||||
return -1;
|
||||
}
|
||||
streams[1] = clCreateBuffer( context, (cl_mem_flags)(CL_MEM_COPY_HOST_PTR), sizeof( cl_double ) * vecSize * TEST_SIZE, &inDataB, &error);
|
||||
streams[1] = clCreateBuffer(context, CL_MEM_COPY_HOST_PTR,
|
||||
sizeof(cl_double) * vecSize * TEST_SIZE,
|
||||
&inDataB, &error);
|
||||
if( streams[1] == NULL )
|
||||
{
|
||||
print_error( error, "Creating input array A failed!\n");
|
||||
|
||||
@@ -158,13 +158,17 @@ int test_equiv_kernel_float(cl_context context, cl_command_queue queue, const ch
|
||||
generate_equiv_test_data_float( inDataA, vecSize, true, d );
|
||||
generate_equiv_test_data_float( inDataB, vecSize, false, d );
|
||||
|
||||
streams[0] = clCreateBuffer( context, (cl_mem_flags)(CL_MEM_COPY_HOST_PTR), sizeof( cl_float ) * vecSize * TEST_SIZE, &inDataA, &error);
|
||||
streams[0] = clCreateBuffer(context, CL_MEM_COPY_HOST_PTR,
|
||||
sizeof(cl_float) * vecSize * TEST_SIZE,
|
||||
&inDataA, &error);
|
||||
if( streams[0] == NULL )
|
||||
{
|
||||
print_error( error, "Creating input array A failed!\n");
|
||||
return -1;
|
||||
}
|
||||
streams[1] = clCreateBuffer( context, (cl_mem_flags)(CL_MEM_COPY_HOST_PTR), sizeof( cl_float ) * vecSize * TEST_SIZE, &inDataB, &error);
|
||||
streams[1] = clCreateBuffer(context, CL_MEM_COPY_HOST_PTR,
|
||||
sizeof(cl_float) * vecSize * TEST_SIZE,
|
||||
&inDataB, &error);
|
||||
if( streams[1] == NULL )
|
||||
{
|
||||
print_error( error, "Creating input array A failed!\n");
|
||||
|
||||
@@ -89,13 +89,19 @@ int test_any_all_kernel(cl_context context, cl_command_queue queue,
|
||||
generate_random_data( vecType, TEST_SIZE * g_vector_aligns[vecSize], d, inDataA );
|
||||
memset( clearData, 0, sizeof( clearData ) );
|
||||
|
||||
streams[0] = clCreateBuffer( context, (cl_mem_flags)(CL_MEM_COPY_HOST_PTR), get_explicit_type_size( vecType ) * g_vector_aligns[vecSize] * TEST_SIZE, &inDataA, &error);
|
||||
streams[0] = clCreateBuffer(context, CL_MEM_COPY_HOST_PTR,
|
||||
get_explicit_type_size(vecType)
|
||||
* g_vector_aligns[vecSize] * TEST_SIZE,
|
||||
&inDataA, &error);
|
||||
if( streams[0] == NULL )
|
||||
{
|
||||
print_error( error, "Creating input array A failed!\n");
|
||||
return -1;
|
||||
}
|
||||
streams[1] = clCreateBuffer( context, (cl_mem_flags)(CL_MEM_COPY_HOST_PTR), sizeof(cl_int) * g_vector_aligns[vecSize] * TEST_SIZE, clearData, &error );
|
||||
streams[1] =
|
||||
clCreateBuffer(context, CL_MEM_COPY_HOST_PTR,
|
||||
sizeof(cl_int) * g_vector_aligns[vecSize] * TEST_SIZE,
|
||||
clearData, &error);
|
||||
if( streams[1] == NULL )
|
||||
{
|
||||
print_error( error, "Creating output array failed!\n");
|
||||
@@ -363,19 +369,28 @@ int test_select_kernel(cl_context context, cl_command_queue queue, const char *f
|
||||
generate_random_data( vecType, TEST_SIZE * g_vector_aligns[vecSize], d, inDataB );
|
||||
generate_random_data( testVecType, TEST_SIZE * g_vector_aligns[vecSize], d, inDataC );
|
||||
|
||||
streams[0] = clCreateBuffer( context, (cl_mem_flags)(CL_MEM_COPY_HOST_PTR), get_explicit_type_size( vecType ) * g_vector_aligns[vecSize] * TEST_SIZE, &inDataA, &error);
|
||||
streams[0] = clCreateBuffer(context, CL_MEM_COPY_HOST_PTR,
|
||||
get_explicit_type_size(vecType)
|
||||
* g_vector_aligns[vecSize] * TEST_SIZE,
|
||||
&inDataA, &error);
|
||||
if( streams[0] == NULL )
|
||||
{
|
||||
print_error( error, "Creating input array A failed!\n");
|
||||
return -1;
|
||||
}
|
||||
streams[1] = clCreateBuffer( context, (cl_mem_flags)(CL_MEM_COPY_HOST_PTR), get_explicit_type_size( vecType ) * g_vector_aligns[vecSize] * TEST_SIZE, &inDataB, &error);
|
||||
streams[1] = clCreateBuffer(context, CL_MEM_COPY_HOST_PTR,
|
||||
get_explicit_type_size(vecType)
|
||||
* g_vector_aligns[vecSize] * TEST_SIZE,
|
||||
&inDataB, &error);
|
||||
if( streams[1] == NULL )
|
||||
{
|
||||
print_error( error, "Creating input array A failed!\n");
|
||||
return -1;
|
||||
}
|
||||
streams[2] = clCreateBuffer( context, (cl_mem_flags)(CL_MEM_COPY_HOST_PTR), get_explicit_type_size( testVecType ) * g_vector_aligns[vecSize] * TEST_SIZE, &inDataC, &error);
|
||||
streams[2] = clCreateBuffer(context, CL_MEM_COPY_HOST_PTR,
|
||||
get_explicit_type_size(testVecType)
|
||||
* g_vector_aligns[vecSize] * TEST_SIZE,
|
||||
&inDataC, &error);
|
||||
if( streams[2] == NULL )
|
||||
{
|
||||
print_error( error, "Creating input array A failed!\n");
|
||||
|
||||
@@ -621,16 +621,22 @@ int test_shuffle_dual_kernel(cl_context context, cl_command_queue queue,
|
||||
if( shuffleMode == kBuiltInDualInputFnMode )
|
||||
generate_random_data( vecType, (unsigned int)( numOrders * inVecSize ), d, inSecondData );
|
||||
|
||||
streams[0] = clCreateBuffer( context, (cl_mem_flags)(CL_MEM_COPY_HOST_PTR), typeSize * inVecSize * numOrders, inData, &error);
|
||||
streams[0] =
|
||||
clCreateBuffer(context, CL_MEM_COPY_HOST_PTR,
|
||||
typeSize * inVecSize * numOrders, inData, &error);
|
||||
test_error( error, "Unable to create input stream" );
|
||||
|
||||
streams[1] = clCreateBuffer( context, (cl_mem_flags)(CL_MEM_COPY_HOST_PTR), typeSize * outRealVecSize * numOrders, outData, &error);
|
||||
streams[1] =
|
||||
clCreateBuffer(context, CL_MEM_COPY_HOST_PTR,
|
||||
typeSize * outRealVecSize * numOrders, outData, &error);
|
||||
test_error( error, "Unable to create output stream" );
|
||||
|
||||
int argIndex = 0;
|
||||
if( shuffleMode == kBuiltInDualInputFnMode )
|
||||
{
|
||||
streams[2] = clCreateBuffer( context, (cl_mem_flags)(CL_MEM_COPY_HOST_PTR), typeSize * inVecSize * numOrders, inSecondData, &error);
|
||||
streams[2] = clCreateBuffer(context, CL_MEM_COPY_HOST_PTR,
|
||||
typeSize * inVecSize * numOrders,
|
||||
inSecondData, &error);
|
||||
test_error( error, "Unable to create second input stream" );
|
||||
|
||||
error = clSetKernelArg( kernel, argIndex++, sizeof( streams[ 2 ] ), &streams[ 2 ] );
|
||||
|
||||
Reference in New Issue
Block a user