10#include <kernel/backend.hpp>
11#include <kernel/util/memory_arbiter.hpp>
13namespace FEAT::LAFEM::Arch
17 template <
typename DT_>
18 static void exec_generic_impl(DT_ * r,
const DT_ alpha,
const DT_ *
const x,
const DT_ *
const y,
const DT_ *
const z,
const Index rows,
const Index cols,
const Index inner);
20 static void exec_mkl_impl(
float * r,
const float alpha,
const float *
const x,
const float *
const y,
const float *
const z,
const Index rows,
const Index cols,
const Index inner);
21 static void exec_mkl_impl(
double * r,
const double alpha,
const double *
const x,
const double *
const y,
const double *
const z,
const Index rows,
const Index cols,
const Index inner);
23 template <
typename DT_>
24 static void exec_mkl_impl(DT_ *,
const DT_,
const DT_ *
const,
const DT_ *
const,
const DT_ *
const,
const Index,
const Index,
const Index)
26 XABORTM(
"LAFEM::Arch::MatMatMultDenseDense::exec_mkl_impl: MKL backend not available!");
29 template <
typename DT_>
30 static void exec_cuda_impl(DT_ * r,
const DT_ alpha,
const DT_ *
const x,
const DT_ *
const y,
const DT_ *
const z,
const Index rows,
const Index cols,
const Index inner);
32 template <
typename DT_>
41 exec_generic_impl(r_view.
get_w(), alpha, x_view.
get_r(), y_view.
get_r(), z_view.
get_r(), rows, cols, inner);
44 exec_generic_impl(r_view.
get_w(), alpha, x_view.
get_r(), y_view.
get_r(), (DT_*)
nullptr, rows, cols, inner);
47 template <
typename DT_>
56 exec_mkl_impl(r_view.
get_w(), alpha, x_view.
get_r(), y_view.
get_r(), z_view.
get_r(), rows, cols, inner);
59 exec_mkl_impl(r_view.
get_w(), alpha, x_view.
get_r(), y_view.
get_r(), (DT_*)
nullptr, rows, cols, inner);
62 template <
typename DT_>
71 exec_cuda_impl(r_view.
get_w(), alpha, x_view.
get_r(), y_view.
get_r(), z_view.
get_r(), rows, cols, inner);
74 exec_cuda_impl(r_view.
get_w(), alpha, x_view.
get_r(), y_view.
get_r(), (DT_*)
nullptr, rows, cols, inner);
77 template <
typename DT_>
86 exec_generic<DT_>(r, alpha, x, y, z, rows, cols, inner);
91 exec_mkl<DT_>(r, alpha, x, y, z, rows, cols, inner);
93 XABORTM(
"LAFEM::Arch::MatMatMultDenseDense::exec: MKL backend not available!");
99 exec_cuda<DT_>(r, alpha, x, y, z, rows, cols, inner);
101 XABORTM(
"LAFEM::Arch::MatMatMultDenseDense::exec: CUDA backend not available!");
109 extern template void MatMatMultDenseDense::exec_generic_impl(
float *,
const float,
const float *
const,
const float *
const,
const float *
const,
const Index,
const Index,
const Index);
110 extern template void MatMatMultDenseDense::exec_generic_impl(
double *,
const double,
const double *
const,
const double *
const,
const double *
const,
const Index,
const Index,
const Index);
115#define KERNEL_LAFEM_ARCH_MATMATMULT_DENSE_DENSE_HPP 1
116#include <kernel/lafem/arch/matmatmult_dense_dense_generic.hpp>
#define XABORTM(msg)
Abortion macro definition with custom message.
#define XASSERT(expr)
Assertion macro definition.
static PreferredBackend get_preferred_backend()
get current preferred backend
const T_ * get_r() const
Returns a const typed pointer to the array that grants read access.
T_ * get_w()
Returns a typed pointer to the array that grants write (and read) access.
@ overlap
explicitly allow overlapping writes (see Overlapping Memory Views)
@ write
write-only access (see attention note above)
std::uint64_t Index
Index data type.