31#ifndef REMORA_KERNELS_GEMM_HPP
32#define REMORA_KERNELS_GEMM_HPP
35#ifdef REMORA_USE_CBLAS
41#include "../proxy_expressions.hpp"
47 template <
class E1,
class E2,
class Mat,
class Orientation1,
class Orientation2>
49 matrix_expression<E1, cpu_tag>
const& e1,
50 matrix_expression<E2, cpu_tag>
const& e2,
51 matrix_expression<Mat, cpu_tag>& m,
52 typename Mat::value_type alpha,
53 row_major, Orientation1, Orientation2,
56 dense_gemm(e1,e2,m,alpha);
59 template<
class M,
class E1,
class E2,
class Orientation1,
class Orientation2,
class Tag1,
class Tag2>
61 matrix_expression<E1, cpu_tag>
const& e1,
62 matrix_expression<E2, cpu_tag>
const& e2,
63 matrix_expression<M, cpu_tag>& m,
64 typename M::value_type alpha,
65 column_major, Orientation1, Orientation2,
68 auto transposedM = trans(m);
69 typedef typename Orientation1::transposed_orientation transpO1;
70 typedef typename Orientation2::transposed_orientation transpO2;
71 gemm(trans(e2),trans(e1),transposedM,alpha,row_major(),transpO2(),transpO1(), Tag2(),Tag1());
85template<
class M,
class E1,
class E2>
87 matrix_expression<E1, cpu_tag>
const& e1,
88 matrix_expression<E2, cpu_tag>
const& e2,
89 matrix_expression<M, cpu_tag>& m,
90 typename M::value_type alpha
92 REMORA_SIZE_CHECK(m().size1() == e1().size1());
93 REMORA_SIZE_CHECK(m().size2() == e2().size2());
94 REMORA_SIZE_CHECK(e1().size2() == e2().size1());
96 typedef typename M::orientation ResultOrientation;
97 typedef typename E1::orientation E1Orientation;
98 typedef typename E2::orientation E2Orientation;
99 typedef typename E1::evaluation_category::tag E1Tag;
100 typedef typename E2::evaluation_category::tag E2Tag;
102 bindings::gemm(e1, e2, m ,alpha,
103 ResultOrientation(), E1Orientation(), E2Orientation(),
110#ifdef REMORA_USE_CLBLAST
112#elif defined REMORA_USE_GPU