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 x,
const Index size);
21 static void exec_mkl_impl(
float * r,
const float alpha,
const float *
const x,
const Index size);
22 static void exec_mkl_impl(
double * r,
const double alpha,
const double *
const x,
const Index size);
24 template <
typename DT_>
25 static void exec_mkl_impl(DT_ *,
const DT_,
const DT_ *
const,
const Index)
27 XABORTM(
"LAFEM::Arch::AxpyDense::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 x,
const Index size);
33 template<
typename DT_>
38 exec_generic_impl(r_view.
get_w(), alpha, x_view.
get_r(), size);
41 template<
typename DT_>
46 exec_mkl_impl(r_view.
get_w(), alpha, x_view.
get_r(), size);
49 template<
typename DT_>
54 exec_cuda_impl(r_view.
get_w(), alpha, x_view.
get_r(), size);
57 template<
typename DT_>
63 exec_generic<DT_>(r, alpha, x, size);
68 exec_mkl<DT_>(r, alpha, x, size);
70 XABORTM(
"LAFEM::Arch::AxpyDense::exec: MKL backend not available!");
76 exec_cuda<DT_>(r, alpha, x, size);
78 XABORTM(
"LAFEM::Arch::AxpyDense::exec: CUDA backend not available!");
83 XABORTM(
"LAFEM::Arch::AxpyDense::exec: unknown backend!");
90 extern template void AxpyDense::exec_generic_impl(
float *,
const float,
const float *
const,
const Index);
91 extern template void AxpyDense::exec_generic_impl(
double *,
const double,
const double *
const,
const Index);
96#define KERNEL_LAFEM_ARCH_AXPY_DENSE_HPP 1
97#include <kernel/lafem/arch/axpy_dense_generic.hpp>
#define XABORTM(msg)
Abortion macro definition with custom message.
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.
@ read_write
read-write access
@ overlap
explicitly allow overlapping writes (see Overlapping Memory Views)
std::uint64_t Index
Index data type.
for 0 <= i < n: r[i] <- r[i] + alpha*x[i]