@@ -59,7 +59,9 @@ hipError_t hipDeviceSetMemPool(int device, hipMemPool_t mem_pool) {
59
59
if ((mem_pool == nullptr ) || (device >= g_devices.size ())) {
60
60
HIP_RETURN (hipErrorInvalidValue);
61
61
}
62
-
62
+ if (!hip::tls.capture_streams_ .empty () || !g_captureStreams.empty ()) {
63
+ HIP_RETURN (hipErrorStreamCaptureUnsupported);
64
+ }
63
65
auto poolDevice = reinterpret_cast <hip::MemoryPool*>(mem_pool)->Device ();
64
66
if (poolDevice->deviceId () != device) {
65
67
HIP_RETURN (hipErrorInvalidDevice);
@@ -328,7 +330,9 @@ hipError_t hipMemPoolCreate(hipMemPool_t* mem_pool, const hipMemPoolProps* pool_
328
330
if (IS_WINDOWS && pool_props->handleTypes == hipMemHandleTypePosixFileDescriptor) {
329
331
HIP_RETURN (hipErrorInvalidValue);
330
332
}
331
-
333
+ if (!hip::tls.capture_streams_ .empty () || !g_captureStreams.empty ()) {
334
+ HIP_RETURN (hipErrorStreamCaptureUnsupported);
335
+ }
332
336
auto device = g_devices[pool_props->location .id ];
333
337
auto pool = new hip::MemoryPool (device, pool_props);
334
338
if (pool == nullptr ) {
@@ -344,6 +348,9 @@ hipError_t hipMemPoolDestroy(hipMemPool_t mem_pool) {
344
348
if (mem_pool == nullptr ) {
345
349
HIP_RETURN (hipErrorInvalidValue);
346
350
}
351
+ if (!hip::tls.capture_streams_ .empty () || !g_captureStreams.empty ()) {
352
+ HIP_RETURN (hipErrorStreamCaptureUnsupported);
353
+ }
347
354
hip::MemoryPool* hip_mem_pool = reinterpret_cast <hip::MemoryPool*>(mem_pool);
348
355
349
356
if (!IsMemPoolValid (hip_mem_pool)) {
0 commit comments