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_* diag,
const DT_*
const val,
const IT_*
const col_idx,
const IT_ *
const row_ptr,
const Index rows,
const int block_size);
21 template <
typename DT_,
typename IT_>
22 static void exec_cuda_impl(DT_ * diag,
const DT_ *
const val,
const IT_ *
const col_idx,
const IT_ *
const row_ptr,
const Index rows,
const int block_soze);
24 template <
typename DT_,
typename IT_>
31 exec_generic_impl(d_view.
get_w(), a_view.
get_r(), ci_view.
get_r(), rp_view.
get_r(), rows, block_size);
34 template <
typename DT_,
typename IT_>
41 exec_cuda_impl(d_view.
get_w(), a_view.
get_r(), ci_view.
get_r(), rp_view.
get_r(), rows, block_size);
44 template <
typename DT_,
typename IT_>
50 exec_generic<DT_, IT_>(diag, val, col_idx, row_ptr, rows, block_size);
56 exec_generic<DT_, IT_>(diag, val, col_idx, row_ptr, rows, block_size);
58 XABORTM(
"LAFEM::Arch::DiagonalBCSR::exec: MKL backend not available!");
64 exec_cuda<DT_, IT_>(diag, val, col_idx, row_ptr, rows, block_size);
66 XABORTM(
"LAFEM::Arch::DiagonalBCSR::exec: CUDA backend not available!");
71 XABORTM(
"LAFEM::Arch::DiagonalBCSR::exec: unknown backend!");
78 extern template void DiagonalBCSR::exec_generic_impl(
float *,
const float *
const,
const Index *
const,
const Index *
const,
const Index,
const int);
79 extern template void DiagonalBCSR::exec_generic_impl(
double *,
const double *
const,
const Index *
const,
const Index *
const,
const Index,
const int);
84#define KERNEL_LAFEM_ARCH_DIAGONAL_BCSR_HPP 1
85#include <kernel/lafem/arch/diagonal_bcsr_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
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.
@ write
write-only access (see attention note above)
std::uint64_t Index
Index data type.
for 0 <= i < n, 0 <= j < blocksize: (diag[i])[j] <- (A[i][i])[j][j]