[CUDA] Recycle CUDA events (#2604)

* Make CudaEvent a CudaHandle

* Add caching for CudaEvent

* Make sure cuda events are destroyed at last

* Fix headers

* SharedEvent => AtomicEvent

* RawCudaEvent => CudaEventHandle, CudaEventWrapper => CopyableCudaEvent

* Remove unneeded asserts
This commit is contained in:
Cheng
2025-09-23 10:42:03 +09:00
committed by GitHub
parent 711a645807
commit ae438d05fa
6 changed files with 159 additions and 110 deletions

View File

@@ -7,7 +7,7 @@ namespace mlx::core {
struct FenceImpl {
uint32_t count;
cu::SharedEvent event;
cu::AtomicEvent event;
};
Fence::Fence(Stream s) {