diff --git a/src/gallium/frontends/rusticl/api/kernel.rs b/src/gallium/frontends/rusticl/api/kernel.rs index 164d0aa1c11..4ab307c6c92 100644 --- a/src/gallium/frontends/rusticl/api/kernel.rs +++ b/src/gallium/frontends/rusticl/api/kernel.rs @@ -857,10 +857,6 @@ fn get_kernel_suggested_local_work_size_khr( return Err(CL_INVALID_GLOBAL_WORK_SIZE); } - if global_work_offset.is_null() { - return Err(CL_INVALID_GLOBAL_OFFSET); - } - // CL_INVALID_VALUE if suggested_local_work_size is NULL. if suggested_local_work_size.is_null() { return Err(CL_INVALID_VALUE); diff --git a/src/gallium/frontends/rusticl/core/kernel.rs b/src/gallium/frontends/rusticl/core/kernel.rs index 613d25ae290..124978e8acd 100644 --- a/src/gallium/frontends/rusticl/core/kernel.rs +++ b/src/gallium/frontends/rusticl/core/kernel.rs @@ -1440,6 +1440,15 @@ impl Kernel { grid: &mut [usize], block: &mut [usize], ) { + // We have to use the required workgroup size if specified. + if self.work_group_size() != [0; 3] { + for i in 0..work_dim { + block[i] = self.work_group_size()[i]; + grid[i] /= block[i]; + } + return; + } + let mut threads = self.max_threads_per_block(d); let dim_threads = d.max_block_sizes(); let subgroups = self.preferred_simd_size(d);