Skip to content

Commit b8607d1

Browse files
committed
Avoid resource leak in CUDA plugin
1 parent 07594d0 commit b8607d1

File tree

1 file changed

+3
-1
lines changed
  • offload/plugins-nextgen/cuda/src

1 file changed

+3
-1
lines changed

offload/plugins-nextgen/cuda/src/rtl.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,9 @@ struct CUDADeviceTy : public GenericDeviceTy {
955955
return Plugin::success();
956956

957957
if (Interop->async_info) {
958-
// TODO: release the stream back to the pool?
958+
if (auto Err = CUDAStreamManager.returnResource(
959+
*static_cast<CUstream *>(Interop->async_info->Queue)))
960+
return Err;
959961
delete Interop->async_info;
960962
}
961963
delete Interop;

0 commit comments

Comments
 (0)