ag_device: Set the default compute device for ag_* operations

View source: R/ag_device.R

ag_deviceR Documentation

Set the default compute device for ag_* operations

Description

Switches all subsequent ag_tensor / ag_param operations to run on the specified device. Calling ag_device("gpu") initialises the best available ggml backend (Vulkan, Metal, CUDA, or CPU fallback) the first time it is called.

Usage

ag_device(device)

Arguments

device

"cpu" (default) or "gpu"

Value

Invisibly the previous device string


ggmlR documentation built on July 14, 2026, 1:08 a.m.