Skip to contents

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

Usage

mlx_synchronize(device = mlx_default_device())

Arguments

device

Execution target: supply "gpu", "cpu", or an mlx_stream created via mlx_new_stream(). Defaults to the current mlx_default_device() unless noted otherwise (helpers that act on an existing array typically reuse that array's device or stream).

Value

Returns NULL invisibly.

Examples

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