GeneralMatrixVector_BLAS.h File Reference

Go to the source code of this file.

Namespaces

 Eigen
 Namespace containing all symbols from the Eigen library.
 
 Eigen::internal
 Namespace containing low-level routines from the Eigen library.
 

Macros

#define EIGEN_BLAS_GEMV_SPECIALIZE(Scalar)
 
#define EIGEN_BLAS_GEMV_SPECIALIZATION(EIGTYPE, BLASTYPE, BLASFUNC)
 

Macro Definition Documentation

◆ EIGEN_BLAS_GEMV_SPECIALIZATION

#define EIGEN_BLAS_GEMV_SPECIALIZATION (   EIGTYPE,
  BLASTYPE,
  BLASFUNC 
)
Value:
template <typename Index, int LhsStorageOrder, bool ConjugateLhs, bool ConjugateRhs> \
struct general_matrix_vector_product_gemv<Index, EIGTYPE, LhsStorageOrder, ConjugateLhs, EIGTYPE, ConjugateRhs> { \
typedef Matrix<EIGTYPE, Dynamic, 1, ColMajor> GEMVVector; \
\
static void run(Index rows, Index cols, const EIGTYPE* lhs, Index lhsStride, const EIGTYPE* rhs, Index rhsIncr, \
EIGTYPE* res, Index resIncr, EIGTYPE alpha) { \
if (rows == 0 || cols == 0) return; \
lda = convert_index<BlasIndex>(lhsStride), incx = convert_index<BlasIndex>(rhsIncr), \
incy = convert_index<BlasIndex>(resIncr); \
const EIGTYPE beta(1); \
const EIGTYPE* x_ptr; \
char trans = (LhsStorageOrder == ColMajor) ? 'N' : (ConjugateLhs) ? 'C' : 'T'; \
if (LhsStorageOrder == RowMajor) { \
m = convert_index<BlasIndex>(cols); \
n = convert_index<BlasIndex>(rows); \
} \
GEMVVector x_tmp; \
if (ConjugateRhs) { \
Map<const GEMVVector, 0, InnerStride<> > map_x(rhs, cols, 1, InnerStride<>(incx)); \
x_tmp = map_x.conjugate(); \
x_ptr = x_tmp.data(); \
incx = 1; \
} else { \
x_ptr = rhs; \
} \
BLASFUNC(&trans, &m, &n, (const BLASTYPE*)&numext::real_ref(alpha), (const BLASTYPE*)lhs, &lda, \
(const BLASTYPE*)x_ptr, &incx, (const BLASTYPE*)&numext::real_ref(beta), (BLASTYPE*)res, &incy); \
} \
};
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
Definition: PartialRedux_count.cpp:3
int rows
Definition: Tutorial_commainit_02.cpp:1
int cols
Definition: Tutorial_commainit_02.cpp:1
Definition: matrices.h:74
@ N
Definition: constructor.cpp:22
@ ColMajor
Definition: Constants.h:318
@ RowMajor
Definition: Constants.h:320
int RealScalar int RealScalar int * incy
Definition: level1_cplx_impl.h:124
if n return
Definition: level1_cplx_impl.h:31
RealScalar alpha
Definition: level1_cplx_impl.h:151
RealScalar RealScalar int * incx
Definition: level1_cplx_impl.h:27
const char const int const RealScalar const RealScalar const int * lda
Definition: level2_cplx_impl.h:20
int * m
Definition: level2_cplx_impl.h:294
Scalar beta
Definition: level2_cplx_impl.h:36
if(UPLO(*uplo)==INVALID) info
Definition: level3_impl.h:428
char * trans
Definition: level2_impl.h:240
EIGEN_DEVICE_FUNC IndexDest convert_index(const IndexSrc &idx)
Definition: XprHelper.h:63
EIGEN_DEVICE_FUNC internal::add_const_on_value_type_t< EIGEN_MATHFUNC_RETVAL(real_ref, Scalar)> real_ref(const Scalar &x)
Definition: MathFunctions.h:1051
int BlasIndex
Definition: MKL_support.h:134
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:83
void run(const string &dir_name, LinearSolver *linear_solver_pt, const unsigned nel_1d, bool mess_up_order)
Definition: two_d_poisson_compare_solvers.cc:317

◆ EIGEN_BLAS_GEMV_SPECIALIZE

#define EIGEN_BLAS_GEMV_SPECIALIZE (   Scalar)
Value:
template <typename Index, bool ConjugateLhs, bool ConjugateRhs> \
struct general_matrix_vector_product<Index, Scalar, const_blas_data_mapper<Scalar, Index, ColMajor>, ColMajor, \
ConjugateLhs, Scalar, const_blas_data_mapper<Scalar, Index, RowMajor>, \
ConjugateRhs, Specialized> { \
static void run(Index rows, Index cols, const const_blas_data_mapper<Scalar, Index, ColMajor>& lhs, \
const const_blas_data_mapper<Scalar, Index, RowMajor>& rhs, Scalar* res, Index resIncr, \
if (ConjugateLhs) { \
general_matrix_vector_product<Index, Scalar, const_blas_data_mapper<Scalar, Index, ColMajor>, ColMajor, \
ConjugateLhs, Scalar, const_blas_data_mapper<Scalar, Index, RowMajor>, \
ConjugateRhs, BuiltIn>::run(rows, cols, lhs, rhs, res, resIncr, alpha); \
} else { \
rows, cols, lhs.data(), lhs.stride(), rhs.data(), rhs.stride(), res, resIncr, alpha); \
} \
} \
}; \
template <typename Index, bool ConjugateLhs, bool ConjugateRhs> \
struct general_matrix_vector_product<Index, Scalar, const_blas_data_mapper<Scalar, Index, RowMajor>, RowMajor, \
ConjugateLhs, Scalar, const_blas_data_mapper<Scalar, Index, ColMajor>, \
ConjugateRhs, Specialized> { \
static void run(Index rows, Index cols, const const_blas_data_mapper<Scalar, Index, RowMajor>& lhs, \
const const_blas_data_mapper<Scalar, Index, ColMajor>& rhs, Scalar* res, Index resIncr, \
rows, cols, lhs.data(), lhs.stride(), rhs.data(), rhs.stride(), res, resIncr, alpha); \
} \
};
SCALAR Scalar
Definition: bench_gemm.cpp:45
@ Specialized
Definition: Constants.h:311
@ BuiltIn
Definition: Constants.h:311