mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-20 06:29:02 +00:00
cl20: Reuse test harness code in clReadWriteImage (#206)
Some of the setup functionality is already there in the test harness, so use that and remove the duplicated code from within the suite. Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
This commit is contained in:
committed by
Kévin Petit
parent
f982d67fad
commit
3c124e0807
@@ -22,11 +22,9 @@ extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gEnablePi
|
||||
extern cl_filter_mode gFilterModeToUse;
|
||||
extern cl_addressing_mode gAddressModeToUse;
|
||||
extern uint64_t gRoundingStartValue;
|
||||
extern cl_command_queue queue;
|
||||
extern cl_context context;
|
||||
|
||||
|
||||
int test_read_image_1D_array( cl_device_id device, image_descriptor *imageInfo, MTdata d )
|
||||
int test_read_image_1D_array( cl_context context, cl_command_queue queue, image_descriptor *imageInfo, MTdata d )
|
||||
{
|
||||
int error;
|
||||
|
||||
@@ -175,7 +173,7 @@ int test_read_image_1D_array( cl_device_id device, image_descriptor *imageInfo,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int test_read_image_set_1D_array( cl_device_id device, cl_image_format *format )
|
||||
int test_read_image_set_1D_array( cl_device_id device, cl_context context, cl_command_queue queue, cl_image_format *format )
|
||||
{
|
||||
size_t maxWidth, maxArraySize;
|
||||
cl_ulong maxAllocSize, memSize;
|
||||
@@ -212,7 +210,7 @@ int test_read_image_set_1D_array( cl_device_id device, cl_image_format *format )
|
||||
if( gDebugTrace )
|
||||
log_info( " at size %d,%d\n", (int)imageInfo.width, (int)imageInfo.arraySize );
|
||||
|
||||
int ret = test_read_image_1D_array( device, &imageInfo, seed );
|
||||
int ret = test_read_image_1D_array( context, queue, &imageInfo, seed );
|
||||
if( ret )
|
||||
return -1;
|
||||
}
|
||||
@@ -239,7 +237,7 @@ int test_read_image_set_1D_array( cl_device_id device, cl_image_format *format )
|
||||
log_info("Testing %d x %d\n", (int)imageInfo.width, (int)imageInfo.arraySize);
|
||||
if( gDebugTrace )
|
||||
log_info( " at max size %d,%d\n", (int)maxWidth, (int)maxArraySize );
|
||||
if( test_read_image_1D_array( device, &imageInfo, seed ) )
|
||||
if( test_read_image_1D_array( context, queue, &imageInfo, seed ) )
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -277,7 +275,7 @@ int test_read_image_set_1D_array( cl_device_id device, cl_image_format *format )
|
||||
|
||||
if( gDebugTrace )
|
||||
log_info( " at size %d,%d (row pitch %d) out of %d,%d\n", (int)imageInfo.width, (int)imageInfo.arraySize, (int)imageInfo.rowPitch, (int)maxWidth, (int)maxArraySize );
|
||||
int ret = test_read_image_1D_array( device, &imageInfo, seed );
|
||||
int ret = test_read_image_1D_array( context, queue, &imageInfo, seed );
|
||||
if( ret )
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user