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

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. More...
 
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. More...
 
template<typename dataT >
void mx::math::hadp (const int N, dataT *Y, dataT *X)
 Template wrapper for cblas-extension xHADP. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 

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 211 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 194 of file templateBLAS.hpp.

References mx::math::hadd_impl().

◆ 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 165 of file templateBLAS.hpp.

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 143 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 114 of file templateBLAS.hpp.

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 63 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 265 of file templateBLAS.hpp.