[gfx12] Finalize support for gfx12 new counter blocks (#81)

1. Move all new gfx12 block enums to aql_profile_v2.h. hsa_ven_amd_aqlprofile.h will be left untouched.
2. Re-org counter info in gfx12_block_info.h to be purely alphabetic-ordered for easy comparison between different IP versions. Also use auto-gen block name from IP header files whenever possible to reduce manual editing.
3. Remove unused counter info from graphics blocks.
4. Added UTCL2 and VML2 support
5. Added all gfx12 blocks to ctrl test

[ROCm/aqlprofile commit: b20803e95d]
This commit is contained in:
Ma, Bing
2025-05-29 15:14:09 -07:00
committed by GitHub
parent 7c4369bde4
commit c50a8225ae
15 changed files with 322 additions and 329 deletions
+10 -2
View File
@@ -285,9 +285,14 @@ class GpuPmcBuilder : public PmcBuilder, protected Primitives {
// std::endl;
// Set GRBM index to access proper block instance
const uint32_t grbm_value = (block_info->instance_count > 1)
//
// TODO: In order to get different event for different instance with WGP counter blocks, we
// need to loop through WGP instead of blindly broadcast instance. Fortunately, this
// is not a common practice
const uint32_t grbm_value = (block_info->instance_count > 1 && !(block_info->attr & CounterBlockWgpAttr))
? Primitives::grbm_inst_index_value(block_des.index)
: Primitives::grbm_broadcast_value();
builder.BuildWriteUConfigRegPacket(cmd_buffer, Primitives::GRBM_GFX_INDEX_ADDR, grbm_value);
// Reset counters
if (block_info->attr & CounterBlockMcAttr) {
@@ -602,9 +607,12 @@ class GpuPmcBuilder : public PmcBuilder, protected Primitives {
else
grbm_value = Primitives::grbm_se_sh_wgp_index_value(se_index, sarray, wgp);
builder.BuildWriteUConfigRegPacket(cmd_buffer, Primitives::GRBM_GFX_INDEX_ADDR, grbm_value);
uint32_t dw_mask = reg_info.register_addr_hi.offset ? 3 : 1;
builder.BuildCopyCounterDataPacket(
cmd_buffer, reg_info.register_addr_lo, reg_info.register_addr_hi,
reinterpret_cast<uint32_t*>(data_buffer) + read_counter, 1);
reinterpret_cast<uint32_t*>(data_buffer) + read_counter, dw_mask);
if (data_buffer && (dw_mask == 1))
*(reinterpret_cast<uint32_t*>(data_buffer) + read_counter + 1) = 0;
read_counter += 2;
}
} else {