ac,radeonsi: add ac_gpu_info::lds_size_per_cu

Both RadeonSI and RADV use the WGP mode, so we can assume 128KB on
GFX10.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3899>
This commit is contained in:
Samuel Pitoiset 2020-02-20 08:48:38 +01:00 committed by Marge Bot
parent cd6ec2b1ab
commit 974c87e449
3 changed files with 10 additions and 7 deletions

View file

@ -496,6 +496,13 @@ bool ac_query_gpu_info(int fd, void *dev_p,
}
info->r600_has_virtual_memory = true;
/* LDS is 64KB per CU (4 SIMDs), which is 16KB per SIMD (usage above
* 16KB makes some SIMDs unoccupied).
*
* LDS is 128KB in WGP mode and 64KB in CU mode. Assume the WGP mode is used.
*/
info->lds_size_per_cu = info->chip_class >= GFX10 ? 128 * 1024 : 64 * 1024;
assert(util_is_power_of_two_or_zero(dma.available_rings + 1));
assert(util_is_power_of_two_or_zero(compute.available_rings + 1));
@ -761,6 +768,7 @@ void ac_print_gpu_info(struct radeon_info *info)
printf(" tcc_cache_line_size = %u\n", info->tcc_cache_line_size);
printf(" tcc_harvested = %u\n", info->tcc_harvested);
printf(" pc_lines = %u\n", info->pc_lines);
printf(" lds_size_per_cu = %u\n", info->lds_size_per_cu);
printf("CP info:\n");
printf(" gfx_ib_pad_with_type2 = %i\n", info->gfx_ib_pad_with_type2);

View file

@ -97,6 +97,7 @@ struct radeon_info {
uint32_t tcc_cache_line_size;
bool tcc_harvested;
unsigned pc_lines;
uint32_t lds_size_per_cu;
/* CP info. */
bool gfx_ib_pad_with_type2;

View file

@ -1063,13 +1063,7 @@ static void si_calculate_max_simd_waves(struct si_shader *shader)
max_simd_waves = MIN2(max_simd_waves, max_vgprs / conf->num_vgprs);
}
/* LDS is 64KB per CU (4 SIMDs) on GFX6-9, which is 16KB per SIMD (usage above
* 16KB makes some SIMDs unoccupied).
*
* LDS is 128KB in WGP mode and 64KB in CU mode. Assume the WGP mode is used.
*/
unsigned max_lds_size = sscreen->info.chip_class >= GFX10 ? 128*1024 : 64*1024;
unsigned max_lds_per_simd = max_lds_size / 4;
unsigned max_lds_per_simd = sscreen->info.lds_size_per_cu / 4;
if (lds_per_wave)
max_simd_waves = MIN2(max_simd_waves, max_lds_per_simd / lds_per_wave);