SWDEV-475185 - Handle device id for hipStreamLegacy
Change-Id: Ib56e6edb77a923f3f9738df64cb9d9ef0b4ba564
Этот коммит содержится в:
1 родитель
ec0971dd08
Коммит
aa6d07518f
1 file changed
+2
-1
@@ -116,8 +116,9 @@ int Stream::DeviceId(const hipStream_t hStream) {
|
||||
//return invalid device id
|
||||
return -1;
|
||||
}
|
||||
bool isNullOrLegacyStream = (hStream == nullptr || hStream == hipStreamLegacy);
|
||||
hip::Stream* s = reinterpret_cast<hip::Stream*>(inputStream);
|
||||
int deviceId = (s != nullptr)? s->DeviceId() : ihipGetDevice();
|
||||
int deviceId = isNullOrLegacyStream ? ihipGetDevice() : s->DeviceId();
|
||||
assert(deviceId >= 0 && deviceId < static_cast<int>(g_devices.size()));
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user