mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
Loading...
Searching...
No Matches

Templatized interface to the BLAS

Functions

template<typename dataT >
void mx::math::scal (const int N, const dataT &alpha, dataT *X, const int incX)
 Template wrapper for cblas xSCAL.
 
template<typename dataT >
void mx::math::hadp_impl (const int N, dataT *__restrict__ Y, dataT *__restrict__ X)
 Implementation of the Hadamard (element-wise) product of two vectors.
 
template<typename dataT >
void mx::math::hadp (const int N, dataT *Y, dataT *X)
 Template wrapper for cblas-extension xHADP.
 
template<typename dataT >
void mx::math::hadd_impl (const int N, const dataT alpha, const dataT *Y, const int incY, dataT *X, const int incX)
 Implementation of the Hadamard (element-wise) division of two vectors.
 
template<typename dataT >
void mx::math::hadd (const int N, const dataT alpha, const dataT *Y, const int incY, dataT *X, const int incX)
 Template wrapper for cblas-extension xHADD.
 
template<typename dataT >
void mx::math::gemm (const CBLAS_ORDER Order, const CBLAS_TRANSPOSE TransA, const CBLAS_TRANSPOSE TransB, const int M, const int N, const int K, const dataT &alpha, const dataT *A, const int lda, const dataT *B, const int ldb, const dataT &beta, dataT *C, const int ldc)
 Template Wrapper for cblas xGEMM.
 
template<typename dataT >
void mx::math::syrk (const CBLAS_ORDER Order, const CBLAS_UPLO Uplo, const CBLAS_TRANSPOSE Trans, const int N, const int K, const dataT &alpha, const dataT *A, const int lda, const dataT &beta, dataT *C, const int ldc)
 Template Wrapper for cblas xSYRK.
 

Function Documentation

◆ gemm()

template<typename dataT >
void mx::math::gemm ( const CBLAS_ORDER  Order,
const CBLAS_TRANSPOSE  TransA,
const CBLAS_TRANSPOSE  TransB,
const int  M,
const int  N,
const int  K,
const dataT alpha,
const dataT A,
const int  lda,
const dataT B,
const int  ldb,
const dataT beta,
dataT C,
const int  ldc 
)

Template Wrapper for cblas xGEMM.

Definition at line 179 of file templateBLAS.hpp.

◆ hadd()

template<typename dataT >
void mx::math::hadd ( const int  N,
const dataT  alpha,
const dataT Y,
const int  incY,
dataT X,
const int  incX 
)

Template wrapper for cblas-extension xHADD.

Computes the the Hadamard or element-wise product: X <- alpha*X/Y

Parameters
N[in] the length of the two vectors
alpha[in] scalar to multiply each element by
Y[in] vector to perform element-wise division with
incY[in] in-memory increment or stride for Y
X[in.out] vector which is multiplied by alpha and element-wise divided by Y
incX[in] in-memeory increment or stride for X
Template Parameters
dataTthe data type of the alpha, X, and Y

Definition at line 168 of file templateBLAS.hpp.

References mx::math::hadd_impl(), and mx::math::six_fifths().

◆ hadd_impl()

template<typename dataT >
void mx::math::hadd_impl ( const int  N,
const dataT  alpha,
const dataT Y,
const int  incY,
dataT X,
const int  incX 
)

Implementation of the Hadamard (element-wise) division of two vectors.

Computes the the Hadamard or element-wise product: X <- alpha*X/Y

Parameters
N[in] the length of the two vectors
alpha[in] scalar to multiply each element by
Y[in] vector to perform element-wise division with
incY[in] in-memory increment or stride for Y
X[in.out] vector which is multiplied by alpha and element-wise divided by Y
incX[in] in-memeory increment or stride for X
Template Parameters
dataTthe data type of the alpha, X, and Y

Definition at line 144 of file templateBLAS.hpp.

References mx::math::six_fifths().

Referenced by mx::math::hadd().

◆ hadp()

template<typename dataT >
void mx::math::hadp ( const int  N,
dataT Y,
dataT X 
)

Template wrapper for cblas-extension xHADP.

Computes the the Hadamard or element-wise product: X <- alpha*X*Y

Parameters
N[in] the length of the two vectors
alpha[in] scalar to multiply each element by
Y[in] vector to perform element-wise multiplication with
incY[in] in-memory increment or stride for Y
X[in.out] vector which is multiplied by alpha and element-wise multiplied by Y
incX[in] in-memeory increment or stride for X
Template Parameters
dataTthe data type of the alpha, X, and Y

Definition at line 124 of file templateBLAS.hpp.

References mx::math::hadp_impl().

◆ hadp_impl()

template<typename dataT >
void mx::math::hadp_impl ( const int  N,
dataT *__restrict__  Y,
dataT *__restrict__  X 
)

Implementation of the Hadamard (element-wise) product of two vectors.

Computes the the Hadamard or element-wise product: X <- alpha*X*Y

Parameters
N[in] the length of the two vectors
alpha[in] scalar to multiply each element by
Y[in] vector to perform element-wise multiplication with
incY[in] in-memory increment or stride for Y
X[in.out] vector which is multiplied by alpha and element-wise multiplied by Y
incX[in] in-memeory increment or stride for X
Template Parameters
dataTthe data type of the alpha, X, and Y

Definition at line 97 of file templateBLAS.hpp.

References mx::math::six_fifths().

Referenced by mx::math::hadp().

◆ scal()

template<typename dataT >
void mx::math::scal ( const int  N,
const dataT alpha,
dataT X,
const int  incX 
)

Template wrapper for cblas xSCAL.

Template Parameters
dataTthe data type of the alpha, X, and Y

Definition at line 61 of file templateBLAS.hpp.

◆ syrk()

template<typename dataT >
void mx::math::syrk ( const CBLAS_ORDER  Order,
const CBLAS_UPLO  Uplo,
const CBLAS_TRANSPOSE  Trans,
const int  N,
const int  K,
const dataT alpha,
const dataT A,
const int  lda,
const dataT beta,
dataT C,
const int  ldc 
)

Template Wrapper for cblas xSYRK.

Definition at line 272 of file templateBLAS.hpp.