SWDEV-372153 - Add hipStreamGetDevice Implementation

Change-Id: Ifd1f13e311e8221ca6d94cf27f9131eb97678067


[ROCm/clr commit: a7049bf7a0]
このコミットが含まれているのは:
Jatin Chaudhary authored and Jatin Jaikishan Chaudhary committed 2023-03-01 04:35:49 -05:00
1 親 37769589f3
コミット 2bcde46b12
6ファイル変更
+66 -1

検索条件に一致するファイルはありません

+24
ファイルの表示
@@ -795,3 +795,27 @@ hipError_t hipExtStreamGetCUMask(hipStream_t stream, uint32_t cuMaskSize, uint32
}
HIP_RETURN(hipSuccess);
}
// ================================================================================================
hipError_t hipStreamGetDevice(hipStream_t stream, hipDevice_t* device) {
HIP_INIT_API(hipStreamGetDevice, stream, device);
if (device == nullptr) {
HIP_RETURN(hipErrorInvalidValue);
}
if (!hip::isValid(stream)) {
return HIP_RETURN(hipErrorContextIsDestroyed);
}
if (stream == nullptr) { // handle null stream
// null stream is associated with current device, return the device id associated with the
// current device
*device = hip::getCurrentDevice()->deviceId();
} else {
getStreamPerThread(stream);
*device = reinterpret_cast<hip::Stream*>(stream)->DeviceId();
}
HIP_RETURN(hipSuccess);
}