9 #ifndef BC_EXPRESSION_TEMPLATES_FUNCTION_GEMV_H_ 10 #define BC_EXPRESSION_TEMPLATES_FUNCTION_GEMV_H_ 22 template<
class lv,
class rv,
class SystemTag>
23 struct Bin_Op<oper::gemv<SystemTag>, lv, rv>:
27 static_assert(std::is_same<
28 typename lv::value_type,
29 typename rv::value_type>::value,
30 "GEMV arguments must have the same value_type");
32 static_assert(lv::tensor_dim == 2 && rv::tensor_dim == 1,
33 "Lv must be a Matrix and Rv must be a Vector");
49 "gemv requires left.cols() == right.rows()");
61 template<
class core,
int Alpha,
int Beta,
class Stream>
63 static_assert(core::tensor_dim==1,
"Gemv out must be a vector");
69 auto contents = traits::template parse_expression<Alpha, Beta>(stream, *
this);
70 auto A = contents.left;
71 auto X = contents.right;
72 auto alpha = contents.alpha;
73 auto beta = contents.beta;
74 bool transA = contents.lv_is_transposed;
76 auto& out = output.
data();
81 stream, transA, A.rows(), A.cols(),
82 alpha.data(), A.data(), A.leading_dim(1),
83 X.data(), X.leading_dim(0),
85 out.data(), out.leading_dim(0));
87 traits::post_parse_expression_evaluation(stream, contents);
SystemTag system_tag
Definition: function_gemv.h:36
Definition: tree_output_data.h:18
#define BCINLINE
Definition: common.h:96
__host__ __device__ bc::size_t size() const
Definition: function_gemv.h:56
static oper::gemv< system_tag > get_operation()
Definition: function_gemv.h:52
typename lv::value_type value_type
Definition: function_gemv.h:35
Definition: blas_expression_template_traits.h:126
Bin_Op(lv left, rv right, oper::gemv< system_tag > op=oper::gemv< system_tag >())
Definition: function_gemv.h:44
int size_t
Definition: common.h:283
void eval(Output_Data< core, Alpha, Beta > output, Stream stream) const
Definition: function_gemv.h:62
rv right
Definition: function_gemv.h:42
Definition: expression_template_base.h:77
lv left
Definition: function_gemv.h:41
BCINLINE bc::size_t dim(int i) const
Definition: expression_binary.h:115
#define BC_ASSERT(condition, message)
Definition: common.h:185
static constexpr int tensor_iterator_dim
Definition: expression_binary.h:56
static constexpr int tensor_dim
Definition: expression_binary.h:30
const Tensor & data() const
Definition: tree_output_data.h:26
__host__ __device__ bc::size_t cols() const
Definition: function_gemv.h:59
__host__ __device__ bc::size_t dim(int i) const
Definition: function_gemv.h:57
__host__ __device__ bc::size_t rows() const
Definition: function_gemv.h:58
The Evaluator determines if an expression needs to be greedily optimized.
Definition: algorithms.h:22