SWDEV-232918

hipEventRecord is much slower in hipclang/vdi

- Make sure default streams don't sync each other.
- Add null stream into the list of default streams.
- Code clean-up to simplify queue look-up.

Change-Id: I36e1fc8d86a600e3dce806694d95d146ed8afd03


[ROCm/hip commit: f7f7337bae]
This commit is contained in:
German Andryeyev
2020-04-23 16:54:48 -04:00
parent c7a4cfc114
commit 0aea572bff
6 changed files with 95 additions and 134 deletions
+3 -12
View File
@@ -48,10 +48,7 @@ hipError_t ihipFree(void *ptr)
}
if (amd::SvmBuffer::malloced(ptr)) {
for (auto& dev : g_devices) {
amd::HostQueue* queue = hip::getNullStream(*dev->asContext());
if (queue != nullptr) {
queue->finish();
}
dev->NullStream()->finish();
}
amd::SvmBuffer::free(*hip::getCurrentDevice()->asContext(), ptr);
return hipSuccess;
@@ -283,10 +280,7 @@ hipError_t ihipArrayDestroy(hipArray* array) {
return hipErrorInvalidValue;
}
for (auto& dev : g_devices) {
amd::HostQueue* queue = hip::getNullStream(*dev->asContext());
if (queue != nullptr) {
queue->finish();
}
dev->NullStream()->finish();
}
as_amd(memObj)->release();
@@ -684,10 +678,7 @@ hipError_t hipHostUnregister(void* hostPtr) {
HIP_INIT_API(hipHostUnregister, hostPtr);
for (auto& dev : g_devices) {
amd::HostQueue* queue = hip::getNullStream(*dev->asContext());
if (queue != nullptr) {
queue->finish();
}
dev->NullStream()->finish();
}
if (amd::SvmBuffer::malloced(hostPtr)) {