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 col_idx,
const IT_ *
const row_ptr,
const IT_ *
const row_idx,
const Index,
const Index,
const Index,
const Index,
const bool);
22 template <
typename DT_,
typename IT_>
23 static void exec_generic(
Memory::Arbiter& r,
const DT_ alpha,
const Memory::Arbiter& x,
const Memory::Arbiter& y,
const Memory::Arbiter& a,
const Memory::Arbiter& col_idx,
const Memory::Arbiter& row_ptr,
const Memory::Arbiter& row_idx,
const Index rows,
const Index cols,
const Index nonzero_rows,
const Index nonzeros,
const bool transposed)
35 ci_view.
get_r(), rp_view.
get_r(), ri_view.
get_r(), rows, cols, nonzero_rows, nonzeros, transposed);
39 exec_generic_impl(r_view.
get_w(), alpha, x_view.
get_r(), (DT_*)
nullptr, a_view.
get_r(),
40 ci_view.
get_r(), rp_view.
get_r(), ri_view.
get_r(), rows, cols, nonzero_rows, nonzeros, transposed);
44 template <
typename DT_,
typename IT_>
45 static void exec(
Memory::Arbiter& r,
const DT_ alpha,
const Memory::Arbiter& x,
const Memory::Arbiter& y,
const Memory::Arbiter& a,
const Memory::Arbiter& col_idx,
const Memory::Arbiter& row_ptr,
const Memory::Arbiter& row_idx,
const Index rows,
const Index cols,
const Index nonzero_rows,
const Index nonzeros,
const bool transposed)
50 exec_generic<DT_, IT_>(r, alpha, x, y, a, col_idx, row_ptr, row_idx, rows, cols, nonzero_rows, nonzeros, transposed);
56 exec_generic<DT_, IT_>(r, alpha, x, y, a, col_idx, row_ptr, row_idx, rows, cols, nonzero_rows, nonzeros, transposed);
58 XABORTM(
"LAFEM::Arch::MatVecMultCSCRDense::exec: MKL backend not available!");
63 XABORTM(
"LAFEM::Arch::MatVecMultCSCRDense::exec: CUDA backend not available!");
67 XABORTM(
"LAFEM::Arch::MatVecMultCSCRDense::exec: unknown backend!");
74 extern template void MatVecMultCSCRDense::exec_generic_impl(
float *,
const float,
const float *
const,
const float *
const,
const float *
const,
const std::uint64_t *
const,
const std::uint64_t *
const,
const std::uint64_t *
const,
const Index,
const Index,
const Index,
const Index,
const bool);
75 extern template void MatVecMultCSCRDense::exec_generic_impl(
float *,
const float,
const float *
const,
const float *
const,
const float *
const,
const std::uint32_t *
const,
const std::uint32_t *
const,
const std::uint32_t *
const,
const Index,
const Index,
const Index,
const Index,
const bool);
76 extern template void MatVecMultCSCRDense::exec_generic_impl(
double *,
const double,
const double *
const,
const double *
const,
const double *
const,
const std::uint64_t *
const,
const std::uint64_t *
const,
const std::uint64_t *
const,
const Index,
const Index,
const Index,
const Index,
const bool);
77 extern template void MatVecMultCSCRDense::exec_generic_impl(
double *,
const double,
const double *
const,
const double *
const,
const double *
const,
const std::uint32_t *
const,
const std::uint32_t *
const,
const std::uint32_t *
const,
const Index,
const Index,
const Index,
const Index,
const bool);
83#define KERNEL_LAFEM_ARCH_MATVECMULT_CSCR_DENSE_HPP 1
84#include <kernel/lafem/arch/matvecmult_cscr_dense_generic.hpp>
#define XABORTM(msg)
Abortion macro definition with custom message.
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]