Skip to content

Commit 9b2f847

Browse files
authored
SWDEV-514950 - [6.4 Preview] fix hipMallocManaged and hipMemAdvise during stream capture (#128)
1 parent 10ef720 commit 9b2f847

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

@@ -153,6 +157,10 @@ hipError_t hipMemAdvise(const void* dev_ptr, size_t count, hipMemoryAdvise advic
153157
HIP_RETURN(hipErrorInvalidValue);
154158
}
155159

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

0 commit comments

Comments
 (0)