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_ *
const x,
const DT_ alpha,
const Index size);
20 static void exec_mkl_impl(
float * r,
const float *
const x,
const float,
const Index size);
21 static void exec_mkl_impl(
double * r,
const double *
const x,
const double,
const Index size);
23 template <
typename DT_>
24 static void exec_mkl_impl(DT_ *,
const DT_ *
const,
const DT_,
const Index)
26 XABORTM(
"LAFEM::Arch::ScaleDense::exec_mkl_impl: MKL backend not available!");
29 template <
typename DT_>
30 static void exec_cuda_impl(DT_ * r,
const DT_ *
const x,
const DT_ alpha,
const Index size);
32 template<
typename DT_>
37 exec_generic_impl(r_view.
get_w(), x_view.
get_r(), alpha, size);
40 template<
typename DT_>
45 exec_mkl_impl(r_view.
get_w(), x_view.
get_r(), alpha, size);
48 template<
typename DT_>
53 exec_cuda_impl(r_view.
get_w(), x_view.
get_r(), alpha, size);
56 template<
typename DT_>
62 exec_generic<DT_>(r, x, alpha, size);
67 exec_mkl<DT_>(r, x, alpha, size);
69 XABORTM(
"LAFEM::Arch::ScaleDense::exec: MKL backend not available!");
75 exec_cuda<DT_>(r, x, alpha, size);
77 XABORTM(
"LAFEM::Arch::ScaleDense::exec: CUDA backend not available!");
82 XABORTM(
"LAFEM::Arch::ScaleDense::exec: unknown backend!");
89 extern template void ScaleDense::exec_generic_impl(
float *,
const float *
const,
const float,
const Index);
90 extern template void ScaleDense::exec_generic_impl(
double *,
const double *
const,
const double,
const Index);
96#define KERNEL_LAFEM_ARCH_SCALE_DENSE_HPP 1
97#include <kernel/lafem/arch/scale_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.
@ overlap
explicitly allow overlapping writes (see Overlapping Memory Views)
@ write
write-only access (see attention note above)
std::uint64_t Index
Index data type.