SWDEV-528686: ATT fix for gfx12 s_wait_idle. Fixes for csv. Default to parse to trace. Fix for ROCR_VISIBLE_DEVICES. (#345)

* Fix for gfx12 s_wait_idle. Added wait field on att.csv

* Format and default to ATT to trace

* Update .mds

* No fatal error for invalid agent

* Tidy fixes

* Rename wait to idle, removed uneeded headers

* Remove unused traceID

* Tidy fix

* Fix csv output

* Formatting

* Fix tests

* Fix tests

* Fix for visible devices

* Review comment: Fix cmake

* Review suggestion

* Remove changelog/readme

* Review comments

* Review comment for CSV

* Formatting

---------

Co-authored-by: Giovanni Baraldi <gbaraldi@amd.com>

[ROCm/rocprofiler-sdk commit: a8f3397069]
This commit is contained in:
Baraldi, Giovanni
2025-04-25 18:49:16 +02:00
committed by GitHub
parent cd106cda3c
commit f91f0712f7
18 changed files with 250 additions and 275 deletions
@@ -64,6 +64,7 @@ union MemoryInst
int ldcnt : 1;
int stcnt : 1;
int sampl : 1;
int idle : 1;
};
int raw = 0;
};
@@ -81,6 +82,13 @@ classify(const std::string& inst)
{
if(inst.find("s_wait_alu") != npos) return MemoryInstType::TYPE_NOT_MEM;
if(inst.find("s_wait_idle") != npos)
{
MemoryInst type = MemoryInstType::TYPE_WAITCNT;
type.idle = true;
return type;
}
MemoryInst type = MemoryInstType::TYPE_WAITCNT;
if(inst.find("dscnt") != npos) type.dscnt = true;
if(inst.find("bvhcnt") != npos) type.bvhcn = true;
@@ -233,31 +241,26 @@ WaitcntList::gfx12_construct(const wave_t& wave, isa_map_t& isa_map)
if(auto joined = expcnt.handle_mem_op(inst_str, empty_list))
mem_unroll.emplace_back(LineWaitcnt{line_number, std::move(*joined)});
}
if(type.sampl)
{
if(auto joined = samplecnt.handle_mem_op(inst_str, empty_list))
mem_unroll.emplace_back(LineWaitcnt{line_number, std::move(*joined)});
}
if(type.kmcnt)
{
if(auto joined = kmcnt.handle_mem_op(inst_str, empty_list))
mem_unroll.emplace_back(LineWaitcnt{line_number, std::move(*joined)});
}
if(type.stcnt)
{
if(auto joined = storecnt.handle_mem_op(inst_str, flat_stor))
mem_unroll.emplace_back(LineWaitcnt{line_number, std::move(*joined)});
}
if(type.ldcnt)
{
if(auto joined = loadcnt.handle_mem_op(inst_str, flat_load))
mem_unroll.emplace_back(LineWaitcnt{line_number, std::move(*joined)});
}
if(type.dscnt)
{
if(auto joined = dscnt.handle_mem_op(inst_str, flat_load))
@@ -271,6 +274,20 @@ WaitcntList::gfx12_construct(const wave_t& wave, isa_map_t& isa_map)
mem_unroll.emplace_back(LineWaitcnt{line_number, std::move(*joined)});
}
}
if(type.idle)
{
std::vector<int> all{};
loadcnt.clearTo(all);
storecnt.clearTo(all);
samplecnt.clearTo(all);
dscnt.clearTo(all);
kmcnt.clearTo(all);
expcnt.clearTo(all);
bvhcnt.clearTo(all);
mem_unroll.emplace_back(LineWaitcnt{line_number, std::move(all)});
}
}
}