SWDEV-283515 - Fix crashing in kernel launch on MGPUS

Fix wrong mixing of current device and stream device in
ihipModuleLaunchKernel() and hipLaunchCooperativeKernel().

Fix missing hipSetDevice() in hipMemcpyWithStream* tests.

Change-Id: I09333bb40d239bb42c832df5ea16d17eeaeff5e7
Bu işleme şunda yer alıyor:
Tao Sang
2021-04-27 19:03:22 -04:00
işlemeyi yapan: Tao Sang
ebeveyn 6b14050424
işleme a95ff95bf7
7 değiştirilmiş dosya ile 25 ekleme ve 20 silme
+7
Dosyayı Görüntüle
@@ -114,6 +114,13 @@ int Stream::DeviceId() const {
return device_->deviceId();
}
int Stream::DeviceId(const hipStream_t hStream) {
hip::Stream* s = reinterpret_cast<hip::Stream*>(hStream);
int deviceId = (s != nullptr)? s->DeviceId() : ihipGetDevice();
assert(deviceId >= 0 && deviceId < static_cast<int>(g_devices.size()));
return deviceId;
}
void Stream::syncNonBlockingStreams() {
amd::ScopedLock lock(streamSetLock);
for (auto& it : streamSet) {