forked from ROCm/hcc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revise roctracer activity callbacks get invoked via ROCR signal callb…
…acks (ROCm#1314) * Revise how roctracer activity callbacks get invoked via ROCR signal callback. Current implementation invokes roctracer only when an HSAOp is disposed. This could be too late for many long-running applications. In this commit we use ROCR signal callbacks instead, which could effectively notify roctracer at a much better timing. * Ensure HSAOp won't be destructed before signalCallback. Introduce SharedWrapper to add reference count to HSAOp. Add a weak_ptr field within HSAOp to track its shared_ptr in HSAQueue::asyncOps. And use the weak_ptr to construct SharedWrapper when registering HSAOp with ROCR runtime signal callback. Combined effect is to guarantee an HSAOp instance won't be destructed prior to getting its ROCR runtime signal callback invoked. * Introduce HSAOp::buildOp factory method. Hides setSelf method into the factory method. * Move SharedWrapper and signalCallback inside HSAOp. Avoid module-scope global types and functions. * Merge redundant logic into one method: HSAOp::registerSignalCallback.
- Loading branch information
Showing
1 changed file
with
98 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters