10#include <kernel/backend.hpp>
11#include <kernel/util/memory_arbiter.hpp>
13namespace FEAT::LAFEM::Arch
18 template <
typename DT_,
typename IT_>
19 static void exec_generic_impl(DT_ * r,
const DT_ alpha,
const DT_ *
const x,
const DT_ *
const y,
const DT_ *
const val,
20 const IT_ *
const offsets,
const Index bands,
const Index rows,
const Index cols);
22 template <
typename DT_,
typename IT_>
23 static void exec_cuda_impl(DT_ * r,
const DT_ alpha,
const DT_ *
const x,
const DT_ *
const y,
const DT_ *
const val,
const IT_ *
const offsets,
const Index bands,
const Index rows,
const Index cols);
25 template <
typename DT_,
typename IT_>
36 o_view.
get_r(), bands, rows, cols);
40 exec_generic_impl(r_view.
get_w(), alpha, x_view.
get_r(), (DT_*)
nullptr, a_view.
get_r(),
41 o_view.
get_r(), bands, rows, cols);
45 template <
typename DT_,
typename IT_>
56 o_view.
get_r(), bands, rows, cols);
60 exec_cuda_impl(r_view.
get_w(), alpha, x_view.
get_r(), (DT_*)
nullptr, a_view.
get_r(),
61 o_view.
get_r(), bands, rows, cols);
65 template <
typename DT_,
typename IT_>
73 exec_generic<DT_, IT_>(r, alpha, x, y, a, offsets, bands, rows, cols);
79 exec_generic<DT_, IT_>(r, alpha, x, y, a, offsets, bands, rows, cols);
81 XABORTM(
"LAFEM::Arch::MatVecMultBandedDense::exec: MKL backend not available!");
87 exec_cuda<DT_, IT_>(r, alpha, x, y, a, offsets, bands, rows, cols);
89 XABORTM(
"LAFEM::Arch::MatVecMultBandedDense::exec: CUDA backend not available!");
94 XABORTM(
"LAFEM::Arch::MatVecMultBandedDense::exec: unknown backend!");
101 extern template void MatVecMultBandedDense::exec_generic_impl(
float *,
const float,
const float *
const,
const float *
const,
const float *
const,
const std::uint64_t *
const,
const Index,
const Index,
const Index);
102 extern template void MatVecMultBandedDense::exec_generic_impl(
float *,
const float,
const float *
const,
const float *
const,
const float *
const,
const std::uint32_t *
const,
const Index,
const Index,
const Index);
103 extern template void MatVecMultBandedDense::exec_generic_impl(
double *,
const double,
const double *
const,
const double *
const,
const double *
const,
const std::uint64_t *
const,
const Index,
const Index,
const Index);
104 extern template void MatVecMultBandedDense::exec_generic_impl(
double *,
const double,
const double *
const,
const double *
const,
const double *
const,
const std::uint32_t *
const,
const Index,
const Index,
const Index);
110#define KERNEL_LAFEM_ARCH_MATVECMULT_BANDED_DENSE_HPP 1
111#include <kernel/lafem/arch/matvecmult_banded_dense_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
static void warn_missing(const char *operation, PreferredBackend preferred_backend, PreferredBackend fallback_backend=PreferredBackend::generic)
issues a warning about unsupported backend usage
View view(Location mem_loc, Access access)
Maps a raw view to a memory block.
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.
r[i] <- y[i] + alpha * sum_{j=0..n-1} A[i][j] * x[j]