Skip to contents

Determines whether the GPU backend was compiled and is available.

Usage

mlx_has_gpu()

Value

Logical: TRUE if GPU is available, FALSE if only CPU.

Examples

if (mlx_has_gpu()) {
  mlx_synchronize("gpu")
} else {
  mlx_synchronize("cpu")
}