as_gpu_matrix: Wrap a matrix so multiplies run on the GPU
Description
Tags a matrix as GPU-backed. In an expression like
as_gpu_matrix(A) %*% B, the multiply dispatches to
ggml_matmul (Vulkan GPU with CPU fallback) instead of R's
built-in. Only one operand needs wrapping. crossprod() and
tcrossprod() on a wrapped matrix likewise use the GPU.
Usage
as_gpu_matrix(x, device = "auto", prec = "f32")
Value
A ggml_matrix.
Arguments
x
A numeric matrix (or something coercible with as.matrix).
device
"auto" (default), "gpu" or "cpu"; see
ggml_matmul.