Skip to content

Commit

Permalink
fix viewable return & event leak
Browse files Browse the repository at this point in the history
  • Loading branch information
leofang committed Sep 6, 2024
1 parent 60682de commit 7770a63
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cuda_py/cuda/py/_memoryview.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ cdef GPUMemoryView view_as_cai(obj, stream_ptr):
cuda.CUevent_flags.CU_EVENT_DISABLE_TIMING))
handle_return(cuda.cuEventRecord(e, producer_s))
handle_return(cuda.cuStreamWaitEvent(consumer_s, e, 0))
handle_return(cuda.cuEventDestroy(e))

return buf

Expand All @@ -275,6 +276,6 @@ def viewable(tuple arg_indices):
cdef int idx
for idx in arg_indices:
args[idx] = _GPUMemoryViewProxy(args[idx])
func(*args, **kwargs)
return func(*args, **kwargs)
return wrapped_func
return wrapped_func_with_indices

0 comments on commit 7770a63

Please sign in to comment.