SWDEV-543350 - restrictions on usage of hipMemcpyWithStream (#727)
* SWDEV-543350 - Do not hipMemcpyWithStream to be called during stream capture * update comment --------- Co-authored-by: Jatin Chaudhary <jatchaud@amd.com>
This commit is contained in:
zatwierdzone przez
GitHub
rodzic
3f6f9d6081
commit
76d2c4135e
@@ -818,11 +818,17 @@ hipError_t hipMemcpy_spt(void* dst, const void* src, size_t sizeBytes, hipMemcpy
|
||||
hipError_t hipMemcpyWithStream(void* dst, const void* src, size_t sizeBytes,
|
||||
hipMemcpyKind kind, hipStream_t stream) {
|
||||
HIP_INIT_API(hipMemcpyWithStream, dst, src, sizeBytes, kind, stream);
|
||||
STREAM_CAPTURE(hipMemcpyAsync, stream, dst, src, sizeBytes, kind);
|
||||
if (!hip::isValid(stream)) {
|
||||
HIP_RETURN(hipErrorContextIsDestroyed);
|
||||
}
|
||||
|
||||
// Since this API does a MemcpyAsync + sync, and sync during a graph capture
|
||||
// is not allowed, we raise an error here if user tries to use this during a
|
||||
// stream capture.
|
||||
if (hip::Stream::StreamCaptureOngoing(stream) == true) {
|
||||
HIP_RETURN(hipErrorStreamCaptureUnsupported);
|
||||
}
|
||||
|
||||
hip::Stream* hip_stream = hip::getStream(stream);
|
||||
if (hip_stream == nullptr) {
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
|
||||
Reference in New Issue
Block a user