Skip to main content

grouped_mat_mul_shared_with_backend

Function grouped_mat_mul_shared_with_backend 

Source
pub fn grouped_mat_mul_shared_with_backend<T: MatrixScalar + TensorScalar>(
    backend: &mut CpuBackend,
    lhs: &[T],
    rhs: &[T],
    output: &mut [T],
    jobs: &[GroupedGemmJob],
    options: GroupedGemmOptions,
) -> Result<(), GroupedGemmError>
Expand description

Execute grouped GEMMs through one caller-configured CPU backend.

This is the explicit-provider counterpart to grouped_mat_mul_shared. The backend’s configured provider, thread count, and execution domain are preserved; this function never constructs a fallback backend.

§Errors

Rejects the request before touching output, with GroupedGemmError::DimensionOverflow or GroupedGemmError::SpanOverflow on checked descriptor arithmetic, GroupedGemmError::BufferOutOfBounds when a job’s span leaves lhs, rhs, or output, GroupedGemmError::OverlappingOutputs when two jobs write the same element, GroupedGemmError::IncompatibleSharedLhs or GroupedGemmError::IncompatibleSharedRhs when jobs sharing an input offset disagree on its shape, and GroupedGemmError::WorkingMemoryExceeded when the batch exceeds options.max_working_bytes. Returns GroupedGemmError::Backend when building a view over a buffer fails or when backend’s configured provider fails to execute the batch; output may then be partially written.