10#include <kernel/backend.hpp>
11#include <kernel/util/memory_arbiter.hpp>
13namespace FEAT::LAFEM::Arch
18 template <
typename DT_>
19 static void exec_generic_impl(DT_ * r,
const DT_ alpha,
const DT_ *
const y,
const DT_ *
const val,
const DT_ *
const x,
const Index rows,
const Index cols,
bool transpose);
21 static void exec_mkl_impl(
float * r,
const float alpha,
const float *
const y,
const float *
const val,
const float *
const x,
const Index rows,
const Index cols,
bool transpose);
22 static void exec_mkl_impl(
double * r,
const double alpha,
const double *
const y,
const double *
const val,
const double *
const x,
const Index rows,
const Index cols,
bool transpose);
24 template <
typename DT_>
25 static void exec_mkl_impl(DT_ *,
const DT_,
const DT_ *
const,
const DT_ *
const,
const DT_ *
const,
const Index,
const Index,
bool)
27 XABORTM(
"LAFEM::Arch::MatVecMultDenseDense::exec_mkl_impl: MKL backend not available!");
30 template <
typename DT_>
31 static void exec_cuda_impl(DT_ * r,
const DT_ alpha,
const DT_ *
const y,
const DT_ *
const val,
const DT_ *
const x,
const Index rows,
const Index cols,
bool transpose);
33 template <
typename DT_>
42 exec_generic_impl(r_view.
get_w(), alpha, y_view.
get_r(), a_view.
get_r(), x_view.
get_r(), rows, cols, transposed);
46 exec_generic_impl(r_view.
get_w(), alpha, (DT_*)
nullptr, a_view.
get_r(), x_view.
get_r(), rows, cols, transposed);
50 template <
typename DT_>
59 exec_mkl_impl(r_view.
get_w(), alpha, y_view.
get_r(), a_view.
get_r(), x_view.
get_r(), rows, cols, transposed);
63 exec_mkl_impl(r_view.
get_w(), alpha, (DT_*)
nullptr, a_view.
get_r(), x_view.
get_r(), rows, cols, transposed);
67 template <
typename DT_>
76 exec_cuda_impl(r_view.
get_w(), alpha, y_view.
get_r(), a_view.
get_r(), x_view.
get_r(), rows, cols, transposed);
80 exec_cuda_impl(r_view.
get_w(), alpha, (DT_*)
nullptr, a_view.
get_r(), x_view.
get_r(), rows, cols, transposed);
84 template <
typename DT_>
92 exec_generic(r, alpha, y, val, x, rows, cols, transposed);
97 exec_mkl(r, alpha, y, val, x, rows, cols, transposed);
99 XABORTM(
"LAFEM::Arch::MatVecMultDenseDense::exec: MKL backend not available!");
105 exec_cuda(r, alpha, y, val, x, rows, cols, transposed);
107 XABORTM(
"LAFEM::Arch::MatVecMultDenseDense::exec: CUDA backend not available!");
112 XABORTM(
"LAFEM::Arch::MatVecMultDenseDense::exec: unknown backend!");
119 extern template void MatVecMultDenseDense::exec_generic_impl(
float *,
const float,
const float *
const,
const float *
const,
const float *
const,
const Index,
const Index,
bool);
120 extern template void MatVecMultDenseDense::exec_generic_impl(
double *,
const double,
const double *
const,
const double *
const,
const double *
const,
const Index,
const Index,
bool);
126#define KERNEL_LAFEM_ARCH_MATVECMULT_DENSE_DENSE_HPP 1
127#include <kernel/lafem/arch/matvecmult_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.
r[i] <- y[i] + alpha * sum_{j=0..n-1} A[i][j] * x[j]