Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
rjodinchr committed Feb 13, 2024
1 parent 16e3343 commit 5c62489
Show file tree
Hide file tree
Showing 13 changed files with 69 additions and 98 deletions.
19 changes: 5 additions & 14 deletions test_conformance/images/clCopyImage/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,20 +94,11 @@ int test_3Dto2Darray(cl_device_id device, cl_context context, cl_command_queue q
}

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 ),
ADD_TEST( 1Dbuffer),
ADD_TEST( 1DTo1Dbuffer ),
ADD_TEST( 1DbufferTo1D ),
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), ADD_TEST(1Dbuffer),
ADD_TEST(1DTo1Dbuffer), ADD_TEST(1DbufferTo1D),
};

const int test_num = ARRAY_SIZE( test_list );
Expand Down
14 changes: 8 additions & 6 deletions test_conformance/images/clCopyImage/test_copy_1D_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,14 @@ int test_copy_image_size_1D_buffer(cl_context context, cl_command_queue queue,
: width_lod;

// Now pick positions within valid ranges
sourcePos[0] = (width_lod > regionSize[0]) ? (size_t)random_in_range(
0, (int)(width_lod - regionSize[0] - 1), d)
: 0;
destPos[0] = (width_lod > regionSize[0]) ? (size_t)random_in_range(
0, (int)(width_lod - regionSize[0] - 1), d)
: 0;
sourcePos[0] = (width_lod > regionSize[0])
? (size_t)random_in_range(0, (int)(width_lod - regionSize[0] - 1),
d)
: 0;
destPos[0] = (width_lod > regionSize[0])
? (size_t)random_in_range(0, (int)(width_lod - regionSize[0] - 1),
d)
: 0;


// Go for it!
Expand Down
4 changes: 1 addition & 3 deletions test_conformance/images/clCopyImage/test_copy_generic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -440,9 +440,7 @@ int test_copy_image_generic( cl_context context, cl_command_queue queue, image_d
switch(dstImageInfo->type)
{
case CL_MEM_OBJECT_IMAGE1D:
case CL_MEM_OBJECT_IMAGE1D_BUFFER:
dst_lod = destPos[1];
break;
case CL_MEM_OBJECT_IMAGE1D_BUFFER: dst_lod = destPos[1]; break;
case CL_MEM_OBJECT_IMAGE1D_ARRAY:
case CL_MEM_OBJECT_IMAGE2D:
dst_lod = destPos[2];
Expand Down
8 changes: 2 additions & 6 deletions test_conformance/images/clFillImage/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,8 @@ int test_1Dbuffer(cl_device_id device, cl_context context,
}

test_definition test_list[] = {
ADD_TEST( 1D ),
ADD_TEST( 2D ),
ADD_TEST( 3D ),
ADD_TEST( 1Darray ),
ADD_TEST( 2Darray ),
ADD_TEST( 1Dbuffer ),
ADD_TEST(1D), ADD_TEST(2D), ADD_TEST(3D),
ADD_TEST(1Darray), ADD_TEST(2Darray), ADD_TEST(1Dbuffer),
};

const int test_num = ARRAY_SIZE( test_list );
Expand Down
7 changes: 4 additions & 3 deletions test_conformance/images/clFillImage/test_fill_1D_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ int test_fill_image_size_1D_buffer(cl_context context, cl_command_queue queue,
: imageInfo->width;

// Now pick positions within valid ranges
origin[0] = (imageInfo->width > region[0]) ? (size_t)random_in_range(
0, (int)(imageInfo->width - region[0] - 1), d)
: 0;
origin[0] = (imageInfo->width > region[0])
? (size_t)random_in_range(
0, (int)(imageInfo->width - region[0] - 1), d)
: 0;

// Go for it!
retCode = test_fill_image_generic(context, queue, imageInfo, origin,
Expand Down
53 changes: 26 additions & 27 deletions test_conformance/images/clFillImage/test_fill_generic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,7 @@ cl_mem create_image( cl_context context, cl_command_queue queue, BufferOwningPtr
break;
case CL_MEM_OBJECT_IMAGE1D_ARRAY:
case CL_MEM_OBJECT_IMAGE1D:
case CL_MEM_OBJECT_IMAGE1D_BUFFER:
dstPitch2D = mappedSlice;
break;
case CL_MEM_OBJECT_IMAGE1D_BUFFER: dstPitch2D = mappedSlice; break;
}

for ( size_t z = 0; z < depth; z++ )
Expand Down Expand Up @@ -488,29 +486,30 @@ int test_fill_image_generic( cl_context context, cl_command_queue queue, image_d
size_t secondDim = 1;

switch (imageInfo->type) {
case CL_MEM_OBJECT_IMAGE1D_BUFFER:
case CL_MEM_OBJECT_IMAGE1D:
secondDim = 1;
thirdDim = 1;
break;
case CL_MEM_OBJECT_IMAGE2D:
secondDim = imageInfo->height;
thirdDim = 1;
break;
case CL_MEM_OBJECT_IMAGE3D:
secondDim = imageInfo->height;
thirdDim = imageInfo->depth;
break;
case CL_MEM_OBJECT_IMAGE1D_ARRAY:
secondDim = imageInfo->arraySize;
thirdDim = 1;
break;
case CL_MEM_OBJECT_IMAGE2D_ARRAY:
secondDim = imageInfo->height;
thirdDim = imageInfo->arraySize;
break;
default:
log_error("Test error: unhandled image type at %s:%d\n",__FILE__,__LINE__);
case CL_MEM_OBJECT_IMAGE1D_BUFFER:
case CL_MEM_OBJECT_IMAGE1D:
secondDim = 1;
thirdDim = 1;
break;
case CL_MEM_OBJECT_IMAGE2D:
secondDim = imageInfo->height;
thirdDim = 1;
break;
case CL_MEM_OBJECT_IMAGE3D:
secondDim = imageInfo->height;
thirdDim = imageInfo->depth;
break;
case CL_MEM_OBJECT_IMAGE1D_ARRAY:
secondDim = imageInfo->arraySize;
thirdDim = 1;
break;
case CL_MEM_OBJECT_IMAGE2D_ARRAY:
secondDim = imageInfo->height;
thirdDim = imageInfo->arraySize;
break;
default:
log_error("Test error: unhandled image type at %s:%d\n", __FILE__,
__LINE__);
};

// Count the number of bytes successfully matched
Expand Down Expand Up @@ -540,7 +539,7 @@ int test_fill_image_generic( cl_context context, cl_command_queue queue, image_d
if ((imageInfo->type == CL_MEM_OBJECT_IMAGE1D_ARRAY
|| imageInfo->type == CL_MEM_OBJECT_IMAGE1D
|| imageInfo->type == CL_MEM_OBJECT_IMAGE1D_BUFFER))
destPtr += mappedSlice;
destPtr += mappedSlice;
else
destPtr += mappedRow;
}
Expand Down
8 changes: 2 additions & 6 deletions test_conformance/images/clGetInfo/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,8 @@ int test_1Dbuffer(cl_device_id device, cl_context context,
}

test_definition test_list[] = {
ADD_TEST( 1D ),
ADD_TEST( 2D ),
ADD_TEST( 3D ),
ADD_TEST( 1Darray ),
ADD_TEST( 2Darray ),
ADD_TEST( 1Dbuffer ),
ADD_TEST(1D), ADD_TEST(2D), ADD_TEST(3D),
ADD_TEST(1Darray), ADD_TEST(2Darray), ADD_TEST(1Dbuffer),
};

const int test_num = ARRAY_SIZE( test_list );
Expand Down
8 changes: 2 additions & 6 deletions test_conformance/images/clGetInfo/test_2D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,7 @@ int test_get_image_info_single( cl_context context, image_descriptor *imageInfo,
case CL_MEM_OBJECT_IMAGE2D:
case CL_MEM_OBJECT_IMAGE1D_ARRAY:
case CL_MEM_OBJECT_IMAGE2D_ARRAY:
case CL_MEM_OBJECT_IMAGE1D_BUFFER:
required_depth = 0;
break;
case CL_MEM_OBJECT_IMAGE1D_BUFFER: required_depth = 0; break;
case CL_MEM_OBJECT_IMAGE3D:
required_depth = imageInfo->depth;
break;
Expand All @@ -224,9 +222,7 @@ int test_get_image_info_single( cl_context context, image_descriptor *imageInfo,
case CL_MEM_OBJECT_IMAGE1D:
case CL_MEM_OBJECT_IMAGE2D:
case CL_MEM_OBJECT_IMAGE3D:
case CL_MEM_OBJECT_IMAGE1D_BUFFER:
required_array_size = 0;
break;
case CL_MEM_OBJECT_IMAGE1D_BUFFER: required_array_size = 0; break;
case CL_MEM_OBJECT_IMAGE1D_ARRAY:
case CL_MEM_OBJECT_IMAGE2D_ARRAY:
required_array_size = imageInfo->arraySize;
Expand Down
6 changes: 3 additions & 3 deletions test_conformance/images/clGetInfo/test_loops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ int test_image_type( cl_device_id device, cl_context context, cl_mem_object_type
test_return = test_get_image_info_2D_array( device, context, &formatList[ i ], flags );
break;
case CL_MEM_OBJECT_IMAGE1D_BUFFER:
test_return = test_get_image_info_1D_buffer(device, context,
&formatList[i], flags);
break;
test_return = test_get_image_info_1D_buffer(
device, context, &formatList[i], flags);
break;
}

if (test_return) {
Expand Down
8 changes: 2 additions & 6 deletions test_conformance/images/clReadWriteImage/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,8 @@ int test_1Dbuffer(cl_device_id device, cl_context context,
}

test_definition test_list[] = {
ADD_TEST( 1D ),
ADD_TEST( 2D ),
ADD_TEST( 3D ),
ADD_TEST( 1Darray ),
ADD_TEST( 2Darray ),
ADD_TEST( 1Dbuffer ),
ADD_TEST(1D), ADD_TEST(2D), ADD_TEST(3D),
ADD_TEST(1Darray), ADD_TEST(2Darray), ADD_TEST(1Dbuffer),
};

const int test_num = ARRAY_SIZE( test_list );
Expand Down
8 changes: 2 additions & 6 deletions test_conformance/images/kernel_image_methods/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,8 @@ int test_1Dbuffer(cl_device_id device, cl_context context,
}

test_definition test_list[] = {
ADD_TEST( 1D ),
ADD_TEST( 2D ),
ADD_TEST( 3D ),
ADD_TEST( 1Darray ),
ADD_TEST( 2Darray ),
ADD_TEST( 1Dbuffer ),
ADD_TEST(1D), ADD_TEST(2D), ADD_TEST(3D),
ADD_TEST(1Darray), ADD_TEST(2Darray), ADD_TEST(1Dbuffer),
};

const int test_num = ARRAY_SIZE( test_list );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ int test_image_set( cl_device_id device, cl_context context, cl_command_queue qu
case CL_MEM_OBJECT_IMAGE1D:
test_missing_feature(version_check, "image_1D");
case CL_MEM_OBJECT_IMAGE1D_BUFFER:
test_missing_feature(version_check, "image_1D_buffer");
test_missing_feature(version_check, "image_1D_buffer");
case CL_MEM_OBJECT_IMAGE1D_ARRAY:
test_missing_feature(version_check, "image_1D_array");
case CL_MEM_OBJECT_IMAGE2D_ARRAY:
Expand Down
22 changes: 11 additions & 11 deletions test_conformance/images/testBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ enum TypesToTest
// For the clCopyImage test
enum MethodsToTest
{
k1D = ( 1 << 0 ),
k2D = ( 1 << 1 ),
k1DArray = ( 1 << 2 ),
k2DArray = ( 1 << 3 ),
k3D = ( 1 << 4 ),
k2DTo3D = ( 1 << 5 ),
k3DTo2D = ( 1 << 6 ),
k2DArrayTo2D = ( 1 << 7 ),
k2DTo2DArray = ( 1 << 8 ),
k2DArrayTo3D = ( 1 << 9 ),
k3DTo2DArray = ( 1 << 10 ),
k1D = (1 << 0),
k2D = (1 << 1),
k1DArray = (1 << 2),
k2DArray = (1 << 3),
k3D = (1 << 4),
k2DTo3D = (1 << 5),
k3DTo2D = (1 << 6),
k2DArrayTo2D = (1 << 7),
k2DTo2DArray = (1 << 8),
k2DArrayTo3D = (1 << 9),
k3DTo2DArray = (1 << 10),
k1DBuffer = (1 << 11),
k1DTo1DBuffer = (1 << 12),
k1DBufferTo1D = (1 << 13),
Expand Down

0 comments on commit 5c62489

Please sign in to comment.