Low-level backend dispatch for a single operation
Source:R/backend-planning.R
amatrix_dispatch_op.RdResolves the best available backend for op on x,
attempts the GPU-resident path when applicable, and falls back to
the cold path (materializing x to host) if needed. If the
chosen backend does not implement method, the fallback
function is called instead.
Usage
amatrix_dispatch_op(x, op, method = op, y = NULL, args = list(), fallback)Arguments
- x
An
aMatrixobject.- op
Character string. Operation key used for backend selection (e.g.
"matmul","svd").- method
Character string. Name of the backend list element to call. Defaults to
op; override when the backend method name differs from the operation key.- y
Right-hand-side
aMatrixorNULL. Passed to the backend method and used during backend selection.- args
Named list of additional arguments forwarded to the backend method on the cold path.
- fallback
Zero-argument function called when the chosen backend does not implement
method.