From b2b54a0194e42034cd1b536ecb455b4ac20dbdcc Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Sun, 12 Apr 2026 23:56:34 +0200 Subject: [PATCH] rusticl/kernel: implement CL_KERNEL_GLOBAL_WORK_SIZE for custom devices Apparently we are supposed to support this on custom devices. Cc: mesa-stable (cherry picked from commit 97a137ac88cfa9b47fd07867232200c87e215eab) Part-of: --- .pick_status.json | 2 +- src/gallium/frontends/rusticl/api/kernel.rs | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 269940c86ac..126d2b1d6e8 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -974,7 +974,7 @@ "description": "rusticl/kernel: implement CL_KERNEL_GLOBAL_WORK_SIZE for custom devices", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/frontends/rusticl/api/kernel.rs b/src/gallium/frontends/rusticl/api/kernel.rs index 4ab307c6c92..0cd4d272d2d 100644 --- a/src/gallium/frontends/rusticl/api/kernel.rs +++ b/src/gallium/frontends/rusticl/api/kernel.rs @@ -115,6 +115,16 @@ unsafe impl CLInfoObj for cl_kernel { match *q { CL_KERNEL_COMPILE_WORK_GROUP_SIZE => v.write::<[usize; 3]>(kernel.work_group_size()), + CL_KERNEL_GLOBAL_WORK_SIZE => { + // If device is not a custom device and kernel is not a built-in kernel + // clGetKernelWorkGroupInfo returns the error CL_INVALID_VALUE. + if dev.device_type & CL_DEVICE_TYPE_CUSTOM == 0 { + return Err(CL_INVALID_VALUE); + } + + // We don't have any enqueue limits. + v.write::<[usize; 3]>([usize::MAX; 3]) + } CL_KERNEL_LOCAL_MEM_SIZE => v.write::(kernel.local_mem_size(dev)), CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE => { v.write::(kernel.preferred_simd_size(dev))