32 #ifndef REMORA_KERNELS_CBLAS_TRMV_HPP 33 #define REMORA_KERNELS_CBLAS_TRMV_HPP 36 #include <type_traits> 38 namespace remora{
namespace bindings {
41 CBLAS_ORDER
const Order,
42 CBLAS_UPLO
const uplo,
43 CBLAS_TRANSPOSE
const transA,
44 CBLAS_DIAG
const unit,
46 float const *A,
int const lda,
47 float* X,
int const incX
49 cblas_strmv(Order, uplo, transA, unit, N,
56 CBLAS_ORDER
const Order,
57 CBLAS_UPLO
const uplo,
58 CBLAS_TRANSPOSE
const transA,
59 CBLAS_DIAG
const unit,
61 double const *A,
int const lda,
62 double* X,
int const incX
64 cblas_dtrmv(Order, uplo, transA, unit, N,
72 CBLAS_ORDER
const Order,
73 CBLAS_UPLO
const uplo,
74 CBLAS_TRANSPOSE
const transA,
75 CBLAS_DIAG
const unit,
77 std::complex<float>
const *A,
int const lda,
78 std::complex<float>* X,
int const incX
80 cblas_ctrmv(Order, uplo, transA, unit, N,
81 reinterpret_cast<cblas_float_complex_type const *>(A), lda,
82 reinterpret_cast<cblas_float_complex_type *>(X), incX
87 CBLAS_ORDER
const Order,
88 CBLAS_UPLO
const uplo,
89 CBLAS_TRANSPOSE
const transA,
90 CBLAS_DIAG
const unit,
92 std::complex<double>
const *A,
int const lda,
93 std::complex<double>* X,
int const incX
95 cblas_ztrmv(Order, uplo, transA, unit, N,
96 reinterpret_cast<cblas_double_complex_type const *>(A), lda,
97 reinterpret_cast<cblas_double_complex_type *>(X), incX
101 template <
bool upper,
bool unit,
typename MatA,
typename VectorX>
103 matrix_expression<MatA, cpu_tag>
const& A,
104 vector_expression<VectorX, cpu_tag> &x,
107 REMORA_SIZE_CHECK(x().size() == A().size2());
108 REMORA_SIZE_CHECK(A().size2() == A().size1());
109 std::size_t n = A().size1();
110 CBLAS_DIAG cblasUnit = unit?CblasUnit:CblasNonUnit;
111 CBLAS_UPLO cblasUplo = upper?CblasUpper:CblasLower;
112 CBLAS_ORDER stor_ord= (CBLAS_ORDER)storage_order<typename MatA::orientation>::value;
114 auto storageA = A().raw_storage();
115 auto storagex = x().raw_storage();
116 trmv(stor_ord, cblasUplo, CblasNoTrans, cblasUnit, (
int)n,
118 storageA.leading_dimension,
125 template<
class M,
class V>
126 struct has_optimized_trmv: std::integral_constant<bool,
127 allowed_cblas_type<typename M::value_type>::type::value
128 && std::is_same<typename M::value_type, typename V::value_type>::value
129 && std::is_base_of<dense_tag, typename M::storage_type::storage_tag>::value
130 && std::is_base_of<dense_tag, typename V::storage_type::storage_tag>::value