Skip to content

Commit d96016b

Browse files
authored
SWDEV-514950 - fix hipMallocManaged & hipMemAdvise when capturing stream (#413)
1 parent 24cdff6 commit d96016b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

hipamd/src/hip_hmm.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ hipError_t hipMallocManaged(void** dev_ptr, size_t size, unsigned int flags) {
7272
HIP_RETURN(hipErrorInvalidValue);
7373
}
7474

75+
if (!hip::tls.capture_streams_.empty() || !g_captureStreams.empty()) {
76+
HIP_RETURN(hipErrorStreamCaptureUnsupported);
77+
}
78+
7579
HIP_RETURN(ihipMallocManaged(dev_ptr, size), *dev_ptr);
7680
}
7781

@@ -151,6 +155,10 @@ hipError_t hipMemAdvise(const void* dev_ptr, size_t count, hipMemoryAdvise advic
151155
HIP_RETURN(hipErrorInvalidValue);
152156
}
153157

158+
if (!hip::tls.capture_streams_.empty() || !g_captureStreams.empty()) {
159+
HIP_RETURN(hipErrorStreamCaptureUnsupported);
160+
}
161+
154162
size_t offset = 0;
155163
amd::Memory* memObj = getMemoryObject(dev_ptr, offset);
156164
if (memObj && count > (memObj->getSize() - offset)) {

0 commit comments

Comments
 (0)