Skip to contents

Waits for outstanding operations on the specified device or stream to complete.

Usage

mlx_synchronize(device = mlx_device())

Arguments

device

Execution target for APIs that expose a one-off device or stream override. Supply "gpu", "cpu", or an mlx_stream created via mlx_new_stream(). Ordinary array operations use the current mlx_device() instead.

Value

Returns NULL invisibly.

Examples

x <- mlx_matrix(1:4, 2, 2)
mlx_synchronize("cpu")
if (mlx_has_gpu()) mlx_synchronize("gpu")
stream <- mlx_new_stream()
mlx_synchronize(stream)