Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Group GPU child zones by name. #262

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions server/TracyView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8363,18 +8363,19 @@ void View::DrawGpuInfoChildren( const V& children, int64_t ztime )
Vector<uint32_t> v;
};
uint64_t ctime = 0;
unordered_flat_map<int16_t, ChildGroup> cmap;
unordered_flat_map<StringRef, ChildGroup, StringRefHasher, StringRefComparator> cmap;
cmap.reserve( 128 );
for( size_t i=0; i<children.size(); i++ )
{
const auto& child = a(children[i]);
const auto cend = m_worker.GetZoneEnd( child );
const auto ct = cend - child.GpuStart();
const auto srcloc = child.SrcLoc();
const auto name = m_worker.GetSourceLocation( srcloc ).name;
ctime += ct;

auto it = cmap.find( srcloc );
if( it == cmap.end() ) it = cmap.emplace( srcloc, ChildGroup { srcloc } ).first;
auto it = cmap.find( name );
if( it == cmap.end() ) it = cmap.emplace( name, ChildGroup { srcloc } ).first;

it->second.t += ct;
it->second.v.push_back( i );
Expand Down