SWDEV-372153 - Add hipStreamGetDevice Implementation
Change-Id: Ifd1f13e311e8221ca6d94cf27f9131eb97678067
[ROCm/clr commit: a7049bf7a0]
This commit is contained in:
committed by
Jatin Jaikishan Chaudhary
parent
37769589f3
commit
2bcde46b12
@@ -193,6 +193,7 @@ hipStreamCreate
|
||||
hipStreamCreateWithFlags
|
||||
hipStreamCreateWithPriority
|
||||
hipStreamDestroy
|
||||
hipStreamGetDevice
|
||||
hipStreamGetFlags
|
||||
hipStreamQuery
|
||||
hipStreamSynchronize
|
||||
|
||||
@@ -194,6 +194,7 @@ hipStreamCreate
|
||||
hipStreamCreateWithFlags
|
||||
hipStreamCreateWithPriority
|
||||
hipStreamDestroy
|
||||
hipStreamGetDevice
|
||||
hipStreamGetFlags
|
||||
hipStreamQuery
|
||||
hipStreamSynchronize
|
||||
|
||||
@@ -169,6 +169,7 @@ global:
|
||||
hipStreamCreateWithFlags;
|
||||
hipStreamCreateWithPriority;
|
||||
hipStreamDestroy;
|
||||
hipStreamGetDevice;
|
||||
hipStreamGetFlags;
|
||||
hipStreamQuery;
|
||||
hipStreamSynchronize;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user