Mesa (master): radv: round up max_lds_per_simd / lds_per_wave

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Feb 15 15:04:40 UTC 2021


Module: Mesa
Branch: master
Commit: 6a770cae4b936ab2644b88f233d9dd4be50b853f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6a770cae4b936ab2644b88f233d9dd4be50b853f

Author: Rhys Perry <pendingchaos02 at gmail.com>
Date:   Thu Jan 28 13:31:33 2021 +0000

radv: round up max_lds_per_simd / lds_per_wave

If each SIMD has to get an different number of waves, report the maximum.

One example of a situation is when a single-wave workgroup uses more than
max_lds_per_simd. This change causes radv_get_max_waves() to report a
single wave per SIMD instead of none.

Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8761>

---

 src/amd/vulkan/radv_shader.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c
index c7a5ee94869..b6f3073ccf2 100644
--- a/src/amd/vulkan/radv_shader.c
+++ b/src/amd/vulkan/radv_shader.c
@@ -1602,7 +1602,7 @@ radv_get_max_waves(struct radv_device *device,
 
 	unsigned max_lds_per_simd = info->lds_size_per_workgroup / simd_per_workgroup;
 	if (lds_per_wave)
-		max_simd_waves = MIN2(max_simd_waves, max_lds_per_simd / lds_per_wave);
+		max_simd_waves = MIN2(max_simd_waves, DIV_ROUND_UP(max_lds_per_simd, lds_per_wave));
 
 	return chip_class >= GFX10 ? max_simd_waves * (wave_size / 32) : max_simd_waves;
 }



More information about the mesa-commit mailing list