mirror of
https://github.com/ml-explore/mlx.git
synced 2025-12-16 01:49:05 +08:00
[CUDA] Make CudaEvent work with multi-device (#2614)
* Set current device when creating cuda event * Separate cuda events by device * Avoid race condition in pool
This commit is contained in:
@@ -5,9 +5,9 @@
|
||||
|
||||
namespace mlx::core::cu {
|
||||
|
||||
Worker::Worker()
|
||||
: signal_stream_(device(mlx::core::Device::gpu)),
|
||||
signal_event_(cudaEventDisableTiming | cudaEventBlockingSync),
|
||||
Worker::Worker(Device& d)
|
||||
: signal_stream_(d),
|
||||
signal_event_(d, cudaEventDisableTiming | cudaEventBlockingSync),
|
||||
worker_(&Worker::thread_fn, this) {}
|
||||
|
||||
Worker::~Worker() {
|
||||
|
||||
Reference in New Issue
Block a user