SWDEV-475185 - Handle device id for hipStreamLegacy

Change-Id: Ib56e6edb77a923f3f9738df64cb9d9ef0b4ba564
Этот коммит содержится в:
Satyanvesh Dittakavi
2024-07-24 14:47:32 +00:00
родитель ec0971dd08
Коммит aa6d07518f
+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;
}