Blocking and default streams' sync:

Add hip::syncStreams(dev) to sync blocking streams on a given device.
hip::syncStreams(void) should only sync streams on the current device.

Change-Id: Ib6b0735215fa0ed12c646ebd029e9763ee3712ce
This commit is contained in:
Christophe Paquot committed 2020-02-26 08:54:00 -08:00
1 parent f4401ff2b5
commit fa6ed89cff
3 files changed
+24 -11

No files matched your search

+8 -2
View File
@@ -42,14 +42,20 @@ class StreamCallback {
namespace hip {
void syncStreams() {
void syncStreams(int devId) {
amd::ScopedLock lock(streamSetLock);
for (const auto& it : streamSet) {
it->finish();
if (it->device->deviceId() == devId) {
it->finish();
}
}
}
void syncStreams() {
syncStreams(getCurrentDevice()->deviceId());
}
Stream::Stream(hip::Device* dev, amd::CommandQueue::Priority p, unsigned int f) :
queue(nullptr), device(dev), priority(p), flags(f) {}