pub struct ExternalBlasBackend { /* private fields */ }Expand description
Conversion rules for row-major data to column-major BLAS:
Goal: Compute C = A * B where:
- A is m×k (row-major)
- B is k×n (row-major)
- C is m×n (row-major)
Row-major to column-major interpretation:
- Row-major A (m×k) appears as A^T (k×m) in column-major → call this At
- Row-major B (k×n) appears as B^T (n×k) in column-major → call this Bt
- Row-major C (m×n) appears as C^T (n×m) in column-major → call this Ct
- To compute C = A * B, we need: C^T = (A * B)^T = B^T * A^T
- So: Ct = Bt * At
BLAS call transformation:
- Original: C = A * B (row-major world)
- BLAS call: Ct = Bt * At (column-major world)
- transa = ‘N’ (Bt is already transposed-looking, no transpose needed)
- transb = ‘N’ (At is already transposed-looking, no transpose needed)
- Call: dgemm(‘N’, ‘N’, n, m, k, alpha, B, lda, A, ldb, beta, C, ldc)
Dimension conversions:
- m_blas = n (Ct rows = Bt rows)
- n_blas = m (Ct cols = At cols)
- k_blas = k (common dimension)
- lda = n (leading dimension of Bt: n×k in column-major, lda = n)
- ldb = k (leading dimension of At: k×m in column-major, ldb = k)
- ldc = n (leading dimension of Ct: n×m in column-major, ldc = n) External BLAS backend (LP64: 32-bit integers)
Implementations§
Source§impl ExternalBlasBackend
impl ExternalBlasBackend
pub fn new(dgemm: DgemmFnPtr, zgemm: ZgemmFnPtr) -> Self
Trait Implementations§
Source§impl GemmBackend for ExternalBlasBackend
impl GemmBackend for ExternalBlasBackend
Source§unsafe fn dgemm(
&self,
m: usize,
n: usize,
k: usize,
a: *const f64,
b: *const f64,
c: *mut f64,
)
unsafe fn dgemm( &self, m: usize, n: usize, k: usize, a: *const f64, b: *const f64, c: *mut f64, )
Matrix multiplication: C = A * B (f64) Read more
Auto Trait Implementations§
impl Freeze for ExternalBlasBackend
impl RefUnwindSafe for ExternalBlasBackend
impl Send for ExternalBlasBackend
impl Sync for ExternalBlasBackend
impl Unpin for ExternalBlasBackend
impl UnwindSafe for ExternalBlasBackend
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
Source§impl<T> IntoCloned<T> for T
impl<T> IntoCloned<T> for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.