fix test_api min_max_image_buffer_size (#2342)

print a `log_info` and use the minimum value (`1`) for `pixelBytes`
instead of printing an error and returning with an error value.
It allows device exposing a big CL_DEVICE_IMAGE_MAX_BUFFER_SIZE (more
than CL_DEVICE_MAX_MEM_ALLOC_SIZE/2) to pass test_api
min_max_image_buffer_size

Fix #2245
This commit is contained in:
Romaric Jodin
2025-08-12 17:46:59 +02:00
committed by GitHub
parent aef863afa2
commit 86634c07f9

View File

@@ -1088,10 +1088,12 @@ REGISTER_TEST(min_max_image_buffer_size)
pixelBytes = maxAllocSize / maxDimensionPixels; pixelBytes = maxAllocSize / maxDimensionPixels;
if (pixelBytes == 0) if (pixelBytes == 0)
{ {
log_error("Value of CL_DEVICE_IMAGE_MAX_BUFFER_SIZE is greater than " log_info(
"CL_MAX_MEM_ALLOC_SIZE so there is no way to allocate image " "Note, the value of CL_DEVICE_IMAGE_MAX_BUFFER_SIZE is %zu pixels, "
"of maximum size!\n"); "therefore the size of the allocated image may be larger than the "
return -1; "scaled CL_DEVICE_MAX_MEM_ALLOC_SIZE of %" PRIu64 " bytes.\n",
maxDimensionPixels, maxAllocSize);
pixelBytes = 1;
} }
error = -1; error = -1;