SWDEV-326798 - Revert "SWDEV-326798 - Changes in stream sync behavior"

This reverts commit 1932e88970.

Reason for revert: HIP tests on windows fails

Change-Id: I795ed19d76a41e2fd9971414cefa5bd3be45d4bc


[ROCm/clr commit: 08c8972d97]
このコミットが含まれているのは:
Sourabh Betigeri
2023-02-28 02:28:12 -05:00
コミット 02a3fcff26
4個のファイルの変更14行の追加19行の削除
+5 -6
ファイルの表示
@@ -91,12 +91,12 @@ void setCurrentDevice(unsigned int index) {
amd::Os::setPreferredNumaNode(preferredNumaNode);
}
hip::Stream* getStream(hipStream_t stream, bool wait) {
hip::Stream* getStream(hipStream_t stream) {
if (stream == nullptr) {
return getNullStream(wait);
return getNullStream();
} else {
hip::Stream* hip_stream = reinterpret_cast<hip::Stream*>(stream);
if (wait && !(hip_stream->Flags() & hipStreamNonBlocking)) {
if (!(hip_stream->Flags() & hipStreamNonBlocking)) {
constexpr bool WaitNullStreamOnly = true;
iHipWaitActiveStreams(hip_stream, WaitNullStreamOnly);
}
@@ -131,10 +131,9 @@ int getDeviceID(amd::Context& ctx) {
}
// ================================================================================================
hip::Stream* getNullStream(bool wait) {
hip::Stream* getNullStream() {
Device* device = getCurrentDevice();
constexpr bool kSkipAlloc = false;
return device ? device->NullStream(kSkipAlloc, wait) : nullptr;
return device ? device->NullStream() : nullptr;
}
};
+3 -5
ファイルの表示
@@ -26,7 +26,7 @@
namespace hip {
// ================================================================================================
hip::Stream* Device::NullStream(bool skip_alloc, bool wait) {
hip::Stream* Device::NullStream(bool skip_alloc) {
if (null_stream_ == nullptr && !skip_alloc) {
null_stream_ = new Stream(this, Stream::Priority::Normal, 0, true);
}
@@ -34,10 +34,8 @@ hip::Stream* Device::NullStream(bool skip_alloc, bool wait) {
if (null_stream_ == nullptr) {
return nullptr;
}
if (wait == true) {
// Wait for all active streams before executing commands on the default
iHipWaitActiveStreams(null_stream_);
}
// Wait for all active streams before executing commands on the default
iHipWaitActiveStreams(null_stream_);
return null_stream_;
}
+4 -3
ファイルの表示
@@ -451,9 +451,10 @@ namespace hip {
void setFlags(unsigned int flags) { flags_ = flags; }
void Reset();
hip::Stream* NullStream(bool skip_alloc = false, bool wait = true);
hip::Stream* NullStream(bool skip_alloc = false);
Stream* GetNullStream();
bool GetActiveStatus() {
amd::ScopedLock lock(lock_);
if (isActive_) return true;
@@ -527,11 +528,11 @@ namespace hip {
/// Get ROCclr queue associated with hipStream
/// Note: This follows the CUDA spec to sync with default streams
/// and Blocking streams
extern hip::Stream* getStream(hipStream_t stream, bool wait = true);
extern hip::Stream* getStream(hipStream_t stream);
/// Get default stream associated with the ROCclr context
extern hip::Stream* getNullStream(amd::Context&);
/// Get default stream of the thread
extern hip::Stream* getNullStream(bool wait = true);
extern hip::Stream* getNullStream();
/// Get device ID associated with the ROCclr context
int getDeviceID(amd::Context& ctx);
/// Check if stream is valid
+2 -5
ファイルの表示
@@ -420,9 +420,8 @@ hipError_t hipStreamSynchronize_common(hipStream_t stream) {
HIP_RETURN(hipErrorStreamCaptureUnsupported);
}
}
bool wait = (stream == nullptr) ? true : false;
// Wait for the current host queue
hip::getStream(stream, wait)->finish();
hip::getStream(stream)->finish();
return hipSuccess;
}
@@ -531,9 +530,7 @@ hipError_t hipStreamQuery_common(hipStream_t stream) {
HIP_RETURN(hipErrorStreamCaptureUnsupported);
}
}
bool wait = (stream == nullptr) ? true : false;
hip::Stream* hip_stream = hip::getStream(stream, wait);
hip::Stream* hip_stream = hip::getStream(stream);
amd::Command* command = hip_stream->getLastQueuedCommand(true);
if (command == nullptr) {