9 #ifndef BC_EXPRESSION_TEMPLATES_FUNCTION_GER_H_ 10 #define BC_EXPRESSION_TEMPLATES_FUNCTION_GER_H_ 21 template<
class lv,
class rv,
class SystemTag>
22 struct Bin_Op<oper::ger<SystemTag>, lv, rv>:
28 typename lv::value_type,
29 typename rv::value_type>::value,
30 "GER arguments must have the same value_type");
32 static_assert(lv::tensor_dim == 1 &&
33 rv::tensor_dim == 1 &&
35 "GER DIMENSION MISMATCH, INTERNAL BUG, REPORT PLEASE");
60 template<
class core,
int Alpha,
int Beta,
class Stream>
62 static_assert(core::tensor_dim==2,
"Ger out must be a matrix");
67 auto& out = output.
data();
72 auto expr = make_bin_expr<oper::Assign>(out, make_scalar_constant<value_type>(Beta));
73 evaluate(expr, stream);
79 auto contents = traits::template parse_expression<Alpha, Beta>(stream, *
this);
80 auto A = contents.left;
81 auto B = contents.right;
82 auto alpha = contents.alpha;
84 alpha.data(), A.data(), A.leading_dim(0),
85 B.data(), B.leading_dim(0),
86 out.data(), out.leading_dim(1));
87 traits::post_parse_expression_evaluation(stream, contents);
89 auto alpha = make_constexpr_scalar<bc::host_tag, (Alpha == 0 ? 1 : Alpha), value_type>();
92 stream.set_blas_pointer_mode_host();
94 alpha.data(), A.data(), A.leading_dim(0),
95 B.data(), B.leading_dim(0),
96 out.data(), out.leading_dim(1));
Bin_Op(lv left, rv right, oper::ger< system_tag > op=oper::ger< system_tag >())
Definition: function_ger.h:46
SystemTag system_tag
Definition: function_ger.h:38
Definition: tree_output_data.h:18
#define BCINLINE
Definition: common.h:96
typename lv::value_type value_type
Definition: function_ger.h:37
void eval(Output_Data< core, Alpha, Beta > output, Stream stream) const
Definition: function_ger.h:61
__host__ __device__ bc::size_t rows() const
Definition: function_ger.h:56
Definition: blas_expression_template_traits.h:126
rv right
Definition: function_ger.h:44
__host__ __device__ bc::size_t dim(int i) const
Definition: function_ger.h:55
static oper::ger< system_tag > get_operation()
Definition: function_ger.h:50
lv left
Definition: function_ger.h:43
int size_t
Definition: common.h:283
__host__ __device__ bc::size_t cols() const
Definition: function_ger.h:57
__host__ __device__ bc::size_t size() const
Definition: function_ger.h:54
Definition: expression_template_base.h:77
BCINLINE bc::size_t dim(int i) const
Definition: expression_binary.h:115
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
The Evaluator determines if an expression needs to be greedily optimized.
Definition: algorithms.h:22