Fix vgpr count calculation for gfx90a and gfx940

Read accum_offset from compute_pgm_rsrc3 to report both the arch vgprs
and the accum vgprs

Change-Id: I99e746d54a6a1671e343da5658cc6ce970f79939
This commit is contained in:
Laurent Morichetti
2022-07-22 11:23:58 -07:00
parent 18dedbaee8
commit 5fd1c7e8e3
3 changed files with 88 additions and 23 deletions
-5
View File
@@ -354,11 +354,6 @@ const AgentInfo* HsaRsrcFactory::AddAgentInfo(const hsa_agent_t agent) {
status = hsa_api_.hsa_amd_agent_iterate_memory_pools(agent, FindStandardPool, &agent_info->gpu_pool);
CHECK_ITER_STATUS("hsa_amd_agent_iterate_memory_pools(gpu pool)", status);
// GFX8 and GFX9 SGPR/VGPR block sizes
agent_info->sgpr_block_dflt = (strcmp(agent_info->gfxip, "gfx8") == 0) ? 1 : 2;
agent_info->sgpr_block_size = 8;
agent_info->vgpr_block_size = 4;
// Set GPU index
agent_info->dev_index = gpu_list_.size();
gpu_list_.push_back(agent_info);
+1 -5
View File
@@ -165,10 +165,6 @@ struct AgentInfo {
// Number of Shader Arrays Per Shader Engines in Gpu
uint32_t shader_arrays_per_se;
// SGPR/VGPR/LDS block sizes
uint32_t sgpr_block_dflt;
uint32_t sgpr_block_size;
uint32_t vgpr_block_size;
static const uint32_t lds_block_size = 128 * 4;
};
@@ -461,7 +457,7 @@ class HsaRsrcFactory {
reinterpret_cast<std::atomic<uint64_t>*>(&(it->second.refs_count));
atomic_ptr->fetch_sub(1, std::memory_order_relaxed);
}
static inline void SetKernelNameRef(const uint64_t& addr, const char* name, const int& free) {
if (symbols_map_ == NULL) {
std::lock_guard<mutex_t> lck(mutex_);