Skip to content
Closed
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
13 changes: 11 additions & 2 deletions libkineto/src/GenericActivityProfiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -593,11 +593,20 @@ void GenericActivityProfiler::toggleCollectionDynamic(const bool enable) {
return;
}
toggleState_.store(enable);

// The ordering of conditions and synchronization is deliberate. We
// intentionally synchronize:
//
// - AFTER we disable
// - BEFORE we enable
//
// Both to prevent the synchronization event from showing up in traces.
if (!enable) {
disableGpuTracing();
}
synchronizeGpuDevice();
if (enable) {
enableGpuTracing();
} else {
disableGpuTracing();
}
}

Expand Down
Loading