From 275a39b3c65bfaa91cd9dcdab66159b8a2d60531 Mon Sep 17 00:00:00 2001 From: Dmitry Baryshkov Date: Tue, 20 May 2025 15:44:08 +0300 Subject: [PATCH] rusticl/device: relax some params for embdded profile As stated in the OpenCL standard, the lowest allowed values CL_DEVICE_MAX_PARAMETER_SIZE and CL_DEVICE_LOCAL_MEM_SIZE in case of the embedded profile are 1K. Limit the check to full profile only, in order to stop forcing OpenCL 1.0 for embedded-profile device like Qualcomm Adreno A702. Backport-to: 25.1 Signed-off-by: Dmitry Baryshkov Reviewed-by: Karol Herbst Part-of: --- src/gallium/frontends/rusticl/core/device.rs | 24 ++++++++++++-------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/gallium/frontends/rusticl/core/device.rs b/src/gallium/frontends/rusticl/core/device.rs index 814a2d206a2..56b062cf522 100644 --- a/src/gallium/frontends/rusticl/core/device.rs +++ b/src/gallium/frontends/rusticl/core/device.rs @@ -568,15 +568,21 @@ impl Device { } if !exts.contains(&"cl_khr_byte_addressable_store") - || !exts.contains(&"cl_khr_global_int32_base_atomics") - || !exts.contains(&"cl_khr_global_int32_extended_atomics") - || !exts.contains(&"cl_khr_local_int32_base_atomics") - || !exts.contains(&"cl_khr_local_int32_extended_atomics") - // The following modifications are made to the OpenCL 1.1 platform layer and runtime (sections 4 and 5): - // The minimum FULL_PROFILE value for CL_DEVICE_MAX_PARAMETER_SIZE increased from 256 to 1024 bytes - || self.param_max_size() < 1024 - // The minimum FULL_PROFILE value for CL_DEVICE_LOCAL_MEM_SIZE increased from 16 KB to 32 KB. - || self.local_mem_size() < 32 * 1024 + || !exts.contains(&"cl_khr_global_int32_base_atomics") + || !exts.contains(&"cl_khr_global_int32_extended_atomics") + || !exts.contains(&"cl_khr_local_int32_base_atomics") + || !exts.contains(&"cl_khr_local_int32_extended_atomics") + { + res = CLVersion::Cl1_0; + } + + if !self.embedded && + // Quoting OpenCL 1.1: + // The following modifications are made to the OpenCL platform layer and runtime (sections 4 and 5): + // The minimum FULL_PROFILE value for CL_DEVICE_MAX_PARAMETER_SIZE increased from 256 to 1024 bytes + (self.param_max_size() < 1024 + // The minimum FULL_PROFILE value for CL_DEVICE_LOCAL_MEM_SIZE increased from 16 KB to 32 KB. + || self.local_mem_size() < 32 * 1024) { res = CLVersion::Cl1_0; }