SWDEV-193956 - [hipclang-vdi-rocm][perf]

~45% to 50% of Performance drop on rocBLAS_int8 test

Add support for active waits without blocking the host thread.

Change-Id: Ie7bb48dcafcb4c93d448bf74749b829b626c3578


[ROCm/clr commit: 0fc433e076]
This commit is contained in:
German Andryeyev
2020-03-02 11:39:13 -05:00
parent 123f91240d
commit 35dee1ac53
3 changed files with 32 additions and 6 deletions
+10 -5
View File
@@ -190,12 +190,17 @@ bool Event::awaitCompletion() {
}
ClPrint(LOG_DEBUG, LOG_WAIT, "waiting for event %p to complete, current status %d", this, status_);
if (command().queue()->vdev()->ActiveWait()) {
while (status_ > CL_COMPLETE) {
amd::Os::yield();
}
} else {
ScopedLock lock(lock_);
ScopedLock lock(lock_);
// Wait until the status becomes CL_COMPLETE or negative.
while (status_ > CL_COMPLETE) {
lock_.wait();
// Wait until the status becomes CL_COMPLETE or negative.
while (status_ > CL_COMPLETE) {
lock_.wait();
}
}
ClPrint(LOG_DEBUG, LOG_WAIT, "event %p wait completed", this);