SWDEV-423317 - Enable GPU wait for hip sync calls
hipStreamSynchronize and hipDeviceSynchronize won't longer wait
for CPU commands in DD mode
Change-Id: I079c8bbfc34ddc6d3e2d74c92a34665877e512a5
[ROCm/clr commit: fbea58ba11]
Этот коммит содержится в:
@@ -122,7 +122,7 @@ int Stream::DeviceId(const hipStream_t hStream) {
|
||||
}
|
||||
|
||||
// ================================================================================================
|
||||
void Stream::SyncAllStreams(int deviceId) {
|
||||
void Stream::SyncAllStreams(int deviceId, bool cpu_wait) {
|
||||
// Make a local copy to avoid stalls for GPU finish with multiple threads
|
||||
std::vector<hip::Stream*> streams;
|
||||
streams.reserve(streamSet.size());
|
||||
@@ -136,7 +136,7 @@ void Stream::SyncAllStreams(int deviceId) {
|
||||
}
|
||||
}
|
||||
for (auto it : streams) {
|
||||
it->finish();
|
||||
it->finish(cpu_wait);
|
||||
it->release();
|
||||
}
|
||||
}
|
||||
@@ -442,8 +442,9 @@ hipError_t hipStreamSynchronize_common(hipStream_t stream) {
|
||||
}
|
||||
}
|
||||
bool wait = (stream == nullptr) ? true : false;
|
||||
constexpr bool kDontWaitForCpu = false;
|
||||
// Wait for the current host queue
|
||||
hip::getStream(stream, wait)->finish();
|
||||
hip::getStream(stream, wait)->finish(kDontWaitForCpu);
|
||||
return hipSuccess;
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user