Skip to content

Commit 24cdff6

Browse files
authored
SWDEV-516511 - fix hipCreateSurfaceObject & hipDestroySurfaceObject when capturing stream (#412)
1 parent c7f3ae6 commit 24cdff6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

hipamd/src/hip_surface.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ hipError_t ihipCreateSurfaceObject(hipSurfaceObject_t* pSurfObject,
6666
return hipErrorInvalidValue;
6767
}
6868

69+
if (!hip::tls.capture_streams_.empty() || !g_captureStreams.empty()) {
70+
HIP_RETURN(hipErrorStreamCaptureUnsupported);
71+
}
72+
6973
amd::Image* image = nullptr;
7074
cl_mem memObj = reinterpret_cast<cl_mem>(pResDesc->res.array.array->data);
7175
if (!is_valid(memObj)) {
@@ -96,6 +100,10 @@ hipError_t ihipDestroySurfaceObject(hipSurfaceObject_t surfaceObject) {
96100
return hipSuccess;
97101
}
98102

103+
if (!hip::tls.capture_streams_.empty() || !g_captureStreams.empty()) {
104+
HIP_RETURN(hipErrorStreamCaptureUnsupported);
105+
}
106+
99107
return ihipFree(surfaceObject);
100108
}
101109

0 commit comments

Comments
 (0)