Fix api/test_api_min_max for Embedded profile with cles_khr_int64 support (#994)

In embedded profile with cles_khr_int64 support,
the test did not consider the size of long. Thus the
number of argument computation was not coherent with
the returned CL_DEVICE_MAX_PARAMETER_SIZE leaded to test failure.
We fix this by taking the size of long when cles_khr_int64
is available in the device extension.
This commit is contained in:
julienhascoet
2020-10-13 10:27:27 +02:00
committed by GitHub
parent d0e97361ae
commit 8ca1537157

View File

@@ -994,6 +994,7 @@ int test_min_max_parameter_size(cl_device_id deviceID, cl_context context, cl_co
size_t decrement;
cl_event event;
cl_int event_status;
bool embeddedNoLong = gIsEmbedded && !gHasLong;
/* Get the max param size */
@@ -1007,8 +1008,9 @@ int test_min_max_parameter_size(cl_device_id deviceID, cl_context context, cl_co
return -1;
}
/* The embedded profile does not require longs, so use ints */
if(gIsEmbedded)
/* The embedded profile without cles_khr_int64 extension does not require
* longs, so use ints */
if (embeddedNoLong)
numberOfIntParametersToTry = numberExpected = (maxSize-sizeof(cl_mem))/sizeof(cl_int);
else
numberOfIntParametersToTry = numberExpected = (maxSize-sizeof(cl_mem))/sizeof(cl_long);
@@ -1024,7 +1026,7 @@ int test_min_max_parameter_size(cl_device_id deviceID, cl_context context, cl_co
clMemWrapper mem;
clKernelWrapper kernel;
if(gIsEmbedded)
if (embeddedNoLong)
{
log_info("Trying a kernel with %ld int arguments (%ld bytes) and one cl_mem (%ld bytes) for %ld bytes total.\n",
numberOfIntParametersToTry, sizeof(cl_int)*numberOfIntParametersToTry, sizeof(cl_mem),