10#include <kernel/backend.hpp>
11#include <kernel/util/memory_arbiter.hpp>
13namespace FEAT::LAFEM::Arch
18 template <
typename DT_>
19 static DT_ exec_generic_impl(
const DT_ *
const x,
const DT_ *
const y,
const Index size);
21 static float exec_mkl_impl(
const float *
const x,
const float *
const y,
const Index size);
22 static double exec_mkl_impl(
const double *
const x,
const double *
const y,
const Index size);
24 template <
typename DT_>
25 static DT_ exec_mkl_impl(
const DT_ *
const,
const DT_ *
const,
const Index)
27 XABORTM(
"LAFEM::Arch::DotProductDense::exec_mkl_impl: MKL backend not available!");
30 template <
typename DT_>
31 static DT_ exec_cuda_impl(
const DT_ *
const x,
const DT_ *
const y,
const Index size);
33 template <
typename DT_>
38 return exec_generic_impl(x_view.
get_r(), y_view.
get_r(), size);
41 template <
typename DT_>
46 return exec_mkl_impl(x_view.
get_r(), y_view.
get_r(), size);
49 template <
typename DT_>
54 return exec_cuda_impl(x_view.
get_r(), y_view.
get_r(), size);
57 template <
typename DT_>
63 return exec_generic<DT_>(x, y, size);
68 return exec_mkl<DT_>(x, y, size);
70 XABORTM(
"LAFEM::Arch::DotProductDense::exec: MKL backend not available!");
76 return exec_cuda<DT_>(x, y, size);
78 XABORTM(
"LAFEM::Arch::DotProductDense::exec: CUDA backend not available!");
83 XABORTM(
"LAFEM::Arch::DotProductDense::exec: unknown backend!");
90 extern template float DotProductDense::exec_generic_impl(
const float *
const,
const float *
const,
const Index);
91 extern template double DotProductDense::exec_generic_impl(
const double *
const,
const double *
const,
const Index);
96#define KERNEL_LAFEM_ARCH_DOT_PRODUCT_DENSE_HPP 1
97#include <kernel/lafem/arch/dot_product_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.
std::uint64_t Index
Index data type.
r <- sum_{0 <= i < n} x[i] * y[i]