rusticl/device: fix custom device detection

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18809>
This commit is contained in:
Karol Herbst 2022-09-25 13:43:13 +02:00 committed by Marge Bot
parent 645f2da3fa
commit 38543af8f7

View file

@ -207,7 +207,7 @@ impl Device {
// Max size of memory object allocation in bytes. The minimum value is
// max(min(1024 × 1024 × 1024, 1/4th of CL_DEVICE_GLOBAL_MEM_SIZE), 32 × 1024 × 1024)
// for devices that are not of type CL_DEVICE_TYPE_CUSTOM.
let mut limit = min(1024 * 1024 * 1024, self.global_mem_size());
let mut limit = min(1024 * 1024 * 1024, self.global_mem_size() / 4);
limit = max(limit, 32 * 1024 * 1024);
if self.max_mem_alloc() < limit {
return true;