Skip to content

Commit 0aacc09

Browse files
sraikund16facebook-github-bot
authored andcommitted
Add 1ns buffer to Roctracer Events (#992)
Summary: Pull Request resolved: #992 As reported in ROCm/roctracer#105, there is an issue where event starts and ends can "tie". This can cause a visual issue in the traces. Lets add a tiny buffer so the events are separate. At the single nanosecond level, the timings are inaccurate anyways so it doesn't really hurt to add this buffer in the meanwhile. Remove/wrap in ifdef once it is issue is resolved Reviewed By: aaronenyeshi Differential Revision: D63296093 fbshipit-source-id: 09e313e55bbee65f5e6a4974dc52b3e0df4d5922
1 parent 0a8763e commit 0aacc09

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

libkineto/src/RoctracerActivity.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,15 @@ struct GpuActivity : public RoctracerActivity<roctracerAsyncRow> {
101101
void log(ActivityLogger& logger) const override;
102102
const std::string metadataJson() const override;
103103

104+
// Add small buffer to fix visual error created by https://github.com/ROCm/roctracer/issues/105
105+
// Once this is resolved we can use ifdef to handle having this buffer or not based on version
106+
int64_t timestamp() const override {
107+
return activity_.begin + 1;
108+
}
109+
int64_t duration() const override {
110+
return activity_.end - (activity_.begin + 1);
111+
}
112+
104113
private:
105114
ActivityType type_;
106115
};

0 commit comments

Comments
 (0)