Add check for support for Read-Wrie images

Read-Write images have required OpenCL 2.x.
Read-Write image tests are already being skipped
for 1.x devices.
With OpenCL 3.0, read-write images being optional,
the tests should be run or skipped
depending on the implementation support.

Add a check to decide if Read-Write images are
supported or required to be supported depending
on OpenCL version and decide if the tests should
be run on skipped.

Fixes issue #894
This commit is contained in:
Nikhil Joshi
2020-09-17 09:28:39 +05:30
parent 055649d81c
commit d9c0a8abf9
9 changed files with 71 additions and 7 deletions

View File

@@ -177,10 +177,11 @@ static int doTest( cl_device_id device, cl_context context, cl_command_queue que
}
}
if (testTypesToRun & kReadWriteTests) {
if (gDeviceLt20) {
log_info("TEST skipped, Opencl 2.0 + requried for this test");
return ret;
if (testTypesToRun & kReadWriteTests)
{
if(checkForReadWriteImageSupport(device))
{
return TEST_SKIPPED_ITSELF;
}
}

View File

@@ -201,6 +201,11 @@ int test_read_image_set_2D( cl_device_id device, cl_context context, cl_command_
image_descriptor imageInfo = { 0 };
size_t pixelSize;
if(gTestReadWrite && checkForReadWriteImageSupport(device))
{
return TEST_SKIPPED_ITSELF;
}
imageInfo.format = format;
imageInfo.depth = imageInfo.arraySize = imageInfo.slicePitch = 0;
imageInfo.type = CL_MEM_OBJECT_IMAGE2D;

View File

@@ -109,9 +109,9 @@ int test_image_set( cl_device_id device, cl_context context, cl_command_queue qu
gDeviceLt20 = true;
}
if (gDeviceLt20 && gTestReadWrite) {
log_info("TEST skipped, Opencl 2.0 + requried for this test");
return ret;
if(gTestReadWrite && checkForReadWriteImageSupport(device))
{
return TEST_SKIPPED_ITSELF;
}
// This flag is only for querying the list of supported formats

View File

@@ -196,6 +196,11 @@ int test_read_image_set_1D( cl_device_id device, cl_context context, cl_command_
RandomSeed seed( gRandomSeed );
int error;
if(gTestReadWrite && checkForReadWriteImageSupport(device))
{
return TEST_SKIPPED_ITSELF;
}
// Get our operating params
size_t maxWidth;
cl_ulong maxAllocSize, memSize;

View File

@@ -198,6 +198,11 @@ int test_read_image_set_1D_array( cl_device_id device, cl_context context, cl_co
image_descriptor imageInfo = { 0 };
size_t pixelSize;
if(gTestReadWrite && checkForReadWriteImageSupport(device))
{
return TEST_SKIPPED_ITSELF;
}
imageInfo.format = format;
imageInfo.height = imageInfo.depth = 0;
imageInfo.type = CL_MEM_OBJECT_IMAGE1D_ARRAY;

View File

@@ -176,6 +176,11 @@ int test_read_image_set_2D_array( cl_device_id device, cl_context context, cl_co
int error;
if(gTestReadWrite && checkForReadWriteImageSupport(device))
{
return TEST_SKIPPED_ITSELF;
}
clProgramWrapper program;
clKernelWrapper kernel;

View File

@@ -179,6 +179,11 @@ int test_read_image_set_3D( cl_device_id device, cl_context context, cl_command_
int error;
if(gTestReadWrite && checkForReadWriteImageSupport(device))
{
return TEST_SKIPPED_ITSELF;
}
clProgramWrapper program;
clKernelWrapper kernel;