% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ag_device.R
\name{ag_device}
\alias{ag_device}
\title{Set the default compute device for ag_* operations}
\usage{
ag_device(device)
}
\arguments{
\item{device}{\code{"cpu"} (default) or \code{"gpu"}}
}
\value{
Invisibly the previous device string
}
\description{
Switches all subsequent \code{ag_tensor} / \code{ag_param} operations to run
on the specified device.  Calling \code{ag_device("gpu")} initialises the
best available ggml backend (Vulkan, Metal, CUDA, or CPU fallback) the first
time it is called.
}
