10#include <kernel/backend.hpp>
11#include <kernel/util/memory_arbiter.hpp>
13namespace FEAT::LAFEM::Arch
17 template <
typename DT_,
typename IT_>
18 static void exec_generic_impl(DT_ * r,
const DT_ alpha,
const DT_ *
const val,
const IT_ *
const col_idx,
const IT_ *
const row_ptr,
const Index nonzeros,
19 const DT_ *
const y,
const DT_*
const z,
const Index rows,
const Index cols,
const Index inner);
21 template <
typename DT_,
typename IT_>
22 static void exec_cuda_impl(DT_ * r,
const DT_ alpha,
const DT_ *
const val,
const IT_ *
const col_idx,
const IT_ *
const row_ptr,
const Index nonzeros,
23 const DT_ *
const y,
const DT_*
const z,
const Index rows,
const Index cols,
const Index inner);
25 template <
typename DT_,
typename IT_>
38 nonzeros, y_view.
get_r(), z_view.
get_r(), rows, cols, inner);
43 nonzeros, y_view.
get_r(), (DT_*)
nullptr, rows, cols, inner);
47 template <
typename DT_,
typename IT_>
60 nonzeros, y_view.
get_r(), z_view.
get_r(), rows, cols, inner);
65 nonzeros, y_view.
get_r(), (DT_*)
nullptr, rows, cols, inner);
69 template <
typename DT_,
typename IT_>
78 exec_generic<DT_, IT_>(r, alpha, val, col_idx, row_ptr, nonzeros, y, z, rows, cols, inner);
84 exec_generic<DT_, IT_>(r, alpha, val, col_idx, row_ptr, nonzeros, y, z, rows, cols, inner);
86 XABORTM(
"LAFEM::Arch::MatMatMultSparseDense::exec: MKL backend not available!");
92 exec_cuda<DT_, IT_>(r, alpha, val, col_idx, row_ptr, nonzeros, y, z, rows, cols, inner);
94 XABORTM(
"LAFEM::Arch::MatMatMultSparseDense::exec: CUDA backend not available!");
102 extern template void MatMatMultSparseDense::exec_generic_impl(
float *,
const float,
const float *
const,
const std::uint64_t *
const,
const std::uint64_t *
const,
const Index,
const float *
const,
const float *
const,
const Index,
const Index,
const Index);
103 extern template void MatMatMultSparseDense::exec_generic_impl(
double *,
const double,
const double *
const,
const std::uint64_t *
const,
const std::uint64_t *
const,
const Index,
const double *
const ,
const double *
const ,
const Index,
const Index,
const Index);
105 extern template void MatMatMultSparseDense::exec_generic_impl(
float *,
const float,
const float *
const,
const std::uint32_t *
const,
const std::uint32_t *
const,
const Index,
const float *
const,
const float *
const,
const Index,
const Index,
const Index);
106 extern template void MatMatMultSparseDense::exec_generic_impl(
double *,
const double,
const double *
const,
const std::uint32_t *
const,
const std::uint32_t *
const,
const Index,
const double *
const,
const double *
const ,
const Index,
const Index,
const Index);
111#define KERNEL_LAFEM_ARCH_MATMATMULT_SPARSE_DENSE_HPP 1
112#include <kernel/lafem/arch/matmatmult_sparse_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
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.