Computes crossprod(A, B) (that is t(A) %*% B) through
'GGML' on the requested backend, using the backend-agnostic residency path:
the operands and result are allocated in one of the backend's own buffers,
the inputs uploaded, the product computed, and the result downloaded. For a
GPU backend the tensors live in device memory, so this is the entry point a
caller uses to run a dense single-precision GEMM on the GPU.
Usage
rggml_mul_mat(A, B, backend = c("cpu", "blas", "vulkan"))Arguments
- A, B
Numeric matrices with the same number of rows (the contracted dimension). Computed in single precision on every backend.
- backend
One of
"cpu"(ggml_backend_cpu_init()),"blas"(offloads the dense F32 product to whatever BLAS the R build links against), or"vulkan"(a Vulkan device; requires Rggml built with--with-vulkanand a visible device, seerggml_vulkan_info()). Errors if the requested backend is unavailable.
Value
A numeric matrix, dim c(ncol(A), ncol(B)), equal to
crossprod(A, B) up to single-precision rounding.