SWDEV-472840 SWDEV-461980 - Fix null stream sync performance
=> If null stream is not created during sync skip nullstrm creation
=> Do cpu wait on blocking & null stream if it exists
Change-Id: I90d6ced6a2dd1782ba58f3fed4e3608fc0efa55a
[ROCm/clr commit: 17e7b7c2ef]
このコミットが含まれているのは:
1 親
0cb25faf88
コミット
bfc89974e0
3ファイル変更
+36
-11
検索条件に一致するファイルはありません
@@ -357,13 +357,23 @@ hipError_t hipStreamSynchronize_common(hipStream_t stream) {
|
||||
HIP_RETURN(hipErrorStreamCaptureUnsupported);
|
||||
}
|
||||
}
|
||||
bool wait = (stream == nullptr || stream == hipStreamLegacy) ? true : false;
|
||||
auto hip_stream = hip::getStream(stream, wait);
|
||||
|
||||
// Wait for the current host queue
|
||||
hip_stream->finish();
|
||||
// Release freed memory for all memory pools on the device
|
||||
hip_stream->GetDevice()->ReleaseFreedMemory();
|
||||
if (stream == nullptr) {
|
||||
// Do cpu wait on null stream and only on blocking streams
|
||||
constexpr bool WaitblockingStreamOnly = true;
|
||||
getCurrentDevice()->SyncAllStreams(true, WaitblockingStreamOnly);
|
||||
|
||||
// Release freed memory for all memory pools on the device
|
||||
getCurrentDevice()->ReleaseFreedMemory();
|
||||
} else {
|
||||
constexpr bool wait = false;
|
||||
auto hip_stream = hip::getStream(stream, wait);
|
||||
|
||||
// Wait for the current host queue
|
||||
hip_stream->finish();
|
||||
// Release freed memory for all memory pools on the device
|
||||
hip_stream->GetDevice()->ReleaseFreedMemory();
|
||||
}
|
||||
return hipSuccess;
|
||||
}
|
||||
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする