Skip to content

Commit

Permalink
fix image/buffer max size
Browse files Browse the repository at this point in the history
OpenCL-CTS is checking that image/buffer max size is below
CL_DEVICE_MAX_MEM_ALLOC_SIZE.
  • Loading branch information
rjodinchr committed Jan 24, 2025
1 parent a91d6a8 commit 85746d5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -724,12 +724,15 @@ cl_int CLVK_API_CALL clGetDeviceInfo(cl_device_id dev,
size_ret = sizeof(val_uint);
break;
case CL_DEVICE_IMAGE_MAX_BUFFER_SIZE:
val_sizet = device->image_max_buffer_size();
val_sizet = std::min(device->image_max_buffer_size(),
device->max_mem_alloc_size());
copy_ptr = &val_sizet;
size_ret = sizeof(val_sizet);
break;
case CL_DEVICE_IMAGE_MAX_ARRAY_SIZE:
val_sizet = device->vulkan_limits().maxImageArrayLayers;
val_sizet =
std::min((uint64_t)device->vulkan_limits().maxImageArrayLayers,
device->max_mem_alloc_size());
copy_ptr = &val_sizet;
size_ret = sizeof(val_sizet);
break;
Expand Down

0 comments on commit 85746d5

Please sign in to comment.