Merge branch 'cl20_trunk'

This commit is contained in:
Kevin Petit
2019-08-01 10:30:10 +01:00
10 changed files with 331 additions and 5 deletions

View File

@@ -1327,14 +1327,19 @@ int test_min_max_constant_buffer_size(cl_device_id deviceID, cl_context context,
log_info("Reported max constant buffer size of %lld bytes.\n", maxSize);
// Limit test buffer size to 1/8 of CL_DEVICE_GLOBAL_MEM_SIZE
error = clGetDeviceInfo(deviceID, CL_DEVICE_GLOBAL_MEM_SIZE, sizeof(maxGlobalSize), &maxGlobalSize, 0);
test_error(error, "Unable to get CL_DEVICE_GLOBAL_MEM_SIZE");
if (maxSize > maxGlobalSize / 8)
maxSize = maxGlobalSize / 8;
error = clGetDeviceInfo(deviceID, CL_DEVICE_MAX_MEM_ALLOC_SIZE , sizeof(maxAllocSize), &maxAllocSize, 0);
test_error(error, "Unable to get CL_DEVICE_MAX_MEM_ALLOC_SIZE ");
if (maxSize > maxAllocSize)
maxSize = maxAllocSize;
/* Create a kernel to test with */
if( create_single_kernel_helper( context, &program, &kernel, 1, sample_const_arg_kernel, "sample_test" ) != 0 )
{
@@ -1426,7 +1431,7 @@ int test_min_max_constant_buffer_size(cl_device_id deviceID, cl_context context,
if (allocPassed) {
if (currentSize < maxSize/PASSING_FRACTION) {
log_error("Failed to allocate at least 1/4 of the reported constant size.\n");
log_error("Failed to allocate at least 1/8 of the reported constant size.\n");
return -1;
} else if (currentSize != maxSize) {
log_info("Passed at reduced size. (%lld of %lld bytes)\n", currentSize, maxSize);