10#include <kernel/backend.hpp>
11#include <kernel/util/memory_arbiter.hpp>
13namespace FEAT::LAFEM::Arch
17 template <
typename DT_>
18 static DT_ exec_generic_impl(
const DT_ *
const x,
const Index size,
const bool min_,
const bool abs_);
20 static float exec_mkl_impl(
const float *
const x,
const Index size,
const bool min_,
const bool abs_);
21 static double exec_mkl_impl(
const double *
const x,
const Index size,
const bool min_,
const bool abs_);
23 template <
typename DT_>
24 static DT_ exec_mkl_impl(
const DT_ *
const,
const Index,
const bool,
const bool)
26 XABORTM(
"LAFEM::Arch::MinMaxValueDense::exec_mkl_impl: MKL backend not available!");
29 template <
typename DT_>
30 static DT_ exec_cuda_impl(
const DT_ *
const x,
const Index size,
const bool min_,
const bool abs_);
32 template <
typename DT_>
33 static DT_ exec_generic(
const Memory::Arbiter& x,
const Index size,
const bool min_,
const bool abs_)
36 return exec_generic_impl(x_view.
get_r(), size, min_, abs_);
39 template <
typename DT_>
40 static DT_ exec_mkl(
const Memory::Arbiter& x,
const Index size,
const bool min_,
const bool abs_)
43 return exec_mkl_impl(x_view.
get_r(), size, min_, abs_);
46 template <
typename DT_>
47 static DT_ exec_cuda(
const Memory::Arbiter& x,
const Index size,
const bool min_,
const bool abs_)
50 return exec_cuda_impl(x_view.
get_r(), size, min_, abs_);
53 template <
typename DT_>
59 return exec_generic<DT_>(x, size, min_, abs_);
64 return exec_mkl<DT_>(x, size, min_, abs_);
66 XABORTM(
"LAFEM::Arch::MinMaxValueDense::exec: MKL backend not available!");
72 return exec_cuda<DT_>(x, size, min_, abs_);
74 XABORTM(
"LAFEM::Arch::MinMaxValueDense::exec: CUDA backend not available!");
79 XABORTM(
"LAFEM::Arch::MinMaxValueDense::exec: unknown backend!");
86 extern template float MinMaxValueDense::exec_generic_impl(
const float *
const,
const Index,
const bool,
const bool);
87 extern template double MinMaxValueDense::exec_generic_impl(
const double *
const,
const Index,
const bool,
const bool);
93#define KERNEL_LAFEM_ARCH_MIN_MAX_VALUE_DENSE_HPP 1
94#include <kernel/lafem/arch/min_max_value_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.