29 template <
typename A,
typename B,
typename C>
30 void outer(
const A& a,
const B& b, C&& c) {
33 a.ensure_cpu_up_to_date();
34 b.ensure_cpu_up_to_date();
35 c.ensure_cpu_up_to_date();
37 if constexpr (all_single_precision<A, B, C>) {
38 cblas_sger(CblasRowMajor, etl::dim<0>(a), etl::dim<0>(b), 1.0, a.memory_start(), 1, b.memory_start(), 1, c.memory_start(), etl::dim<0>(b));
40 cblas_dger(CblasRowMajor, etl::dim<0>(a), etl::dim<0>(b), 1.0, a.memory_start(), 1, b.memory_start(), 1, c.memory_start(), etl::dim<0>(b));
52 template <
typename A,
typename B,
typename C>
58 a.ensure_cpu_up_to_date();
59 b.ensure_cpu_up_to_date();
61 if constexpr (all_single_precision<A, B, C>) {
62 cblas_sgemm(CblasRowMajor, CblasTrans, CblasNoTrans, m, n, k, 1.0f, a.memory_start(), m, b.memory_start(), n, 0.0f, c.memory_start(), n);
64 cblas_dgemm(CblasRowMajor, CblasTrans, CblasNoTrans, m, n, k, 1.0, a.memory_start(), m, b.memory_start(), n, 0.0, c.memory_start(), n);
75 template <
typename A,
typename B,
typename C>
76 void outer(
const A& ,
const B& , C&& ) {
77 cpp_unreachable(
"BLAS not enabled/available");
83 template <
typename A,
typename B,
typename C>
85 cpp_unreachable(
"BLAS not enabled/available");
batch_outer_product_expr< detail::build_type< A >, detail::build_type< B > > batch_outer(A &&a, B &&b)
Batch Outer product multiplication of two matrices.
Definition: batch_outer_product_expr.hpp:333
size_t columns(const E &expr)
Returns the number of columns of the given ETL expression.
Definition: helpers.hpp:78
size_t rows(const E &expr)
Returns the number of rows of the given ETL expression.
Definition: helpers.hpp:58
outer_product_expr< detail::build_type< A >, detail::build_type< B > > outer(A &&a, B &&b)
Outer product multiplication of two matrices.
Definition: outer_product_expr.hpp:293