Skip to main content

GemmBackend

Trait GemmBackend 

Source
pub trait GemmBackend: Send + Sync {
    // Required methods
    unsafe fn dgemm(
        &self,
        transa: Transpose,
        transb: Transpose,
        m: usize,
        n: usize,
        k: usize,
        alpha: f64,
        a: *const f64,
        lda: usize,
        b: *const f64,
        ldb: usize,
        beta: f64,
        c: *mut f64,
        ldc: usize,
    ) -> Result<(), GemmError>;
    unsafe fn zgemm(
        &self,
        transa: Transpose,
        transb: Transpose,
        m: usize,
        n: usize,
        k: usize,
        alpha: Complex<f64>,
        a: *const Complex<f64>,
        lda: usize,
        b: *const Complex<f64>,
        ldb: usize,
        beta: Complex<f64>,
        c: *mut Complex<f64>,
        ldc: usize,
    ) -> Result<(), GemmError>;
    fn name(&self) -> &'static str;

    // Provided method
    fn is_ilp64(&self) -> bool { ... }
}
Expand description

GEMM backend trait for runtime dispatch.

Implementations compute C <- alpha * op(A) * op(B) + beta * C on column-major operands, with BLAS semantics: op(A) is m x k, op(B) is k x n, C is m x n, and C is not read when beta == 0.

Required Methods§

Source

unsafe fn dgemm( &self, transa: Transpose, transb: Transpose, m: usize, n: usize, k: usize, alpha: f64, a: *const f64, lda: usize, b: *const f64, ldb: usize, beta: f64, c: *mut f64, ldc: usize, ) -> Result<(), GemmError>

Real double-precision GEMM.

§Safety

The pointers must address column-major matrices of the stated shapes and leading dimensions (lda >= max(1, rows(A)), and likewise for B and C); c must not alias a or b.

Source

unsafe fn zgemm( &self, transa: Transpose, transb: Transpose, m: usize, n: usize, k: usize, alpha: Complex<f64>, a: *const Complex<f64>, lda: usize, b: *const Complex<f64>, ldb: usize, beta: Complex<f64>, c: *mut Complex<f64>, ldc: usize, ) -> Result<(), GemmError>

Complex double-precision GEMM.

§Safety

Same contract as GemmBackend::dgemm.

Source

fn name(&self) -> &'static str

Backend name for diagnostics.

Provided Methods§

Source

fn is_ilp64(&self) -> bool

Returns true if this backend uses 64-bit integers (ILP64).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§