SWDEV-326798 - Changes in stream sync behavior

Change-Id: If6d0b3876a9bf197c7e49273eaa5ca5bfae46d0b
This commit is contained in:
Sourabh Betigeri authored and Aakash Sudhanwa committed 2023-02-27 16:48:14 -05:00
1 parent a69db9b426
commit 51adec2730
4 file changed
+19 -14

No files matched your search

+6 -5
View File
@@ -91,12 +91,12 @@ void setCurrentDevice(unsigned int index) {
amd::Os::setPreferredNumaNode(preferredNumaNode);
}
hip::Stream* getStream(hipStream_t stream) {
hip::Stream* getStream(hipStream_t stream, bool wait) {
if (stream == nullptr) {
return getNullStream();
return getNullStream(wait);
} else {
hip::Stream* hip_stream = reinterpret_cast<hip::Stream*>(stream);
if (!(hip_stream->Flags() & hipStreamNonBlocking)) {
if (wait && !(hip_stream->Flags() & hipStreamNonBlocking)) {
constexpr bool WaitNullStreamOnly = true;
iHipWaitActiveStreams(hip_stream, WaitNullStreamOnly);
}
@@ -131,9 +131,10 @@ int getDeviceID(amd::Context& ctx) {
}
// ================================================================================================
hip::Stream* getNullStream() {
hip::Stream* getNullStream(bool wait) {
Device* device = getCurrentDevice();
return device ? device->NullStream() : nullptr;
constexpr bool kSkipAlloc = false;
return device ? device->NullStream(kSkipAlloc, wait) : nullptr;
}
};