Skip to main content

mlx_stream_new_thread_unsafe

Function mlx_stream_new_thread_unsafe 

Source
pub unsafe extern "C" fn mlx_stream_new_thread_unsafe(
    dev: mlx_device,
) -> mlx_stream
Expand description

Returns a new stream on a device that can be used from any thread.

Streams are otherwise thread affine: a stream’s GPU command encoder is registered per thread, so evaluating on a stream from a thread other than the one that created it fails. Streams returned here are registered globally instead.

MLX applies no synchronization to these streams – it is the caller’s responsibility to ensure there are no data races on them.