libhsakmt: Fixed VGPR memory size for GFX11.0 and GFX11.1.

Fixed VGPR memory size, size was too small for some GPU, causing a memory overflow.
Refactored macro code into a function.
Thanks to Jay Cornwall for locating the problem and proposing the fix.

Change-Id: Iffedea1c4f341967f02c56d810ff048225b02c16
Signed-off-by: David Belanger <david.belanger@amd.com>


[ROCm/ROCR-Runtime commit: a847a7b80e]
This commit is contained in:
David Belanger
2023-01-24 09:55:04 -05:00
committed by David Belanger
parent b99bf7f3b6
commit dbf94b7dd3
3 changed files with 27 additions and 5 deletions
+3 -3
View File
@@ -149,6 +149,8 @@ enum full_gfx_versions {
GFX_VERSION_VANGOGH = 0x0A0303,
GFX_VERSION_BEIGE_GOBY = 0x0A0304,
GFX_VERSION_YELLOW_CARP = 0x0A0305,
GFX_VERSION_PLUM_BONITO = 0x0B0000,
GFX_VERSION_WHEAT_NAS = 0x0B0001,
};
struct hsa_gfxip_table {
@@ -222,8 +224,6 @@ uint32_t get_num_sysfs_nodes(void);
bool is_forked_child(void);
/* Calculate VGPR and SGPR register file size per CU */
#define VGPR_SIZE_PER_CU(gfxv) \
(((gfxv) == GFX_VERSION_ARCTURUS || \
(gfxv) == GFX_VERSION_ALDEBARAN) ? 0x80000 : 0x40000)
uint32_t get_vgpr_size_per_cu(uint32_t gfxv);
#define SGPR_SIZE_PER_CU 0x4000
#endif