basic/async: Check for extension only once per test (#1242)

As the extension is vector size and type independent, we only need to
check for the extension once per test and not for every possible
combination of inputs, thereby drastically reducing the log output of
the test when the extension is not supported.
This commit is contained in:
Pierre Moreau
2021-05-12 12:39:17 +02:00
committed by GitHub
parent 59a12047a8
commit 06f7661fdc
3 changed files with 22 additions and 22 deletions

View File

@@ -138,13 +138,6 @@ int test_copy3D(cl_device_id deviceID, cl_context context,
vecNameString, srcLineStride, dstLineStride, srcPlaneStride,
dstPlaneStride);
if (!is_extension_available(deviceID, "cl_khr_extended_async_copies"))
{
log_info(
"Device does not support extended async copies. Skipping test.\n");
return 0;
}
cl_long max_local_mem_size;
error =
clGetDeviceInfo(deviceID, CL_DEVICE_LOCAL_MEM_SIZE,
@@ -467,6 +460,13 @@ int test_copy3D_all_types(cl_device_id deviceID, cl_context context,
int errors = 0;
if (!is_extension_available(deviceID, "cl_khr_extended_async_copies"))
{
log_info(
"Device does not support extended async copies. Skipping test.\n");
return 0;
}
for (typeIndex = 0; vecType[typeIndex] != kNumExplicitTypes; typeIndex++)
{
if (vecType[typeIndex] == kDouble