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_ *
const x,
const int stride_r,
const int comp_r,
const int stride_x,
const int comp_x,
const Index count);
21 static void exec_mkl_impl(
float * r,
const float *
const x,
const int stride_r,
const int comp_r,
const int stride_x,
const int comp_x,
const Index count);
22 static void exec_mkl_impl(
double * r,
const double *
const x,
const int stride_r,
const int comp_r,
const int stride_x,
const int comp_x,
const Index count);
24 template <
typename DT_>
25 static void exec_mkl_impl(DT_ *,
const DT_ *
const,
const int,
const int,
const int,
const int,
const Index)
27 XABORTM(
"LAFEM::Arch::CopyStride::exec_mkl_impl: MKL backend not available!");
30 template <
typename DT_>
31 static void exec_cuda_impl(DT_ * r,
const DT_ *
const x,
const int stride_r,
const int comp_r,
const int stride_x,
const int comp_x,
const Index count);
33 template <
typename DT_>
38 exec_generic_impl(r_view.
get_w(), x_view.
get_r(), stride_r, comp_r, stride_x, comp_x, count);
41 template <
typename DT_>
46 exec_mkl_impl(r_view.
get_w(), x_view.
get_r(), stride_r, comp_r, stride_x, comp_x, count);
49 template <
typename DT_>
54 exec_cuda_impl(r_view.
get_w(), x_view.
get_r(), stride_r, comp_r, stride_x, comp_x, count);
57 template <
typename DT_>
67 exec_generic<DT_>(r, x, stride_r, comp_r, stride_x, comp_x, count);
72 exec_mkl<DT_>(r, x, stride_r, comp_r, stride_x, comp_x, count);
74 XABORTM(
"LAFEM::Arch::CopyStride::exec: MKL backend not available!");
80 exec_cuda<DT_>(r, x, stride_r, comp_r, stride_x, comp_x, count);
82 XABORTM(
"LAFEM::Arch::CopyStride::exec: CUDA backend not available!");
87 XABORTM(
"LAFEM::Arch::CopyStride::exec: unknown backend!");
94 extern template void CopyStride::exec_generic_impl(
float *,
const float *
const,
const int,
const int,
const int,
const int,
const Index);
95 extern template void CopyStride::exec_generic_impl(
double *,
const double *
const,
const int,
const int,
const int,
const int,
const Index);
100#define KERNEL_LAFEM_ARCH_COPY_STRIDE_HPP 1
101#include <kernel/lafem/arch/copy_stride_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.
@ read_write
read-write access
@ write
write-only access (see attention note above)
std::uint64_t Index
Index data type.
for 0 <= i < n: r[i*stride_r + comp_r] <- x[i*stride_x + comp_x]