10#include <kernel/backend.hpp>
11#include <kernel/util/memory_arbiter.hpp>
12#include <kernel/util/tiny_algebra.hpp>
16namespace FEAT::LAFEM::Arch
21 template <
typename DT_,
typename IT_,
int bh_,
int bw_>
24 const IT_ *
const col_idx,
const IT_ *
const row_ptr,
const Index rows,
const Index cols,
const Index);
26 template <
typename DT_,
typename IT_,
int bh_,
int bw_>
29 const IT_ *
const col_idx,
const IT_ *
const row_ptr,
const Index rows,
const Index cols,
const Index);
31 static void exec_mkl_impl(
float * r,
const float alpha,
const float *
const x,
const float *
const y,
const float *
const val,
const Index *
const col_idx,
const Index *
const row_ptr,
const Index rows,
const Index cols,
const Index nonzeros,
const int block_size,
const bool transposed);
32 static void exec_mkl_impl(
double * r,
const double alpha,
const double *
const x,
const double *
const y,
const double *
const val,
const Index *
const col_idx,
const Index *
const row_ptr,
const Index rows,
const Index cols,
const Index nonzeros,
const int block_size,
const bool transposed);
34 template <
typename DT_,
typename IT_>
35 static void exec_mkl_impl(DT_ *,
const DT_,
const DT_ *
const,
const DT_ *
const,
const DT_ *
const,
const IT_ *
const,
const IT_ *
const,
const Index,
const Index,
const Index,
const int,
const bool)
37 XABORTM(
"LAFEM::Arch::MatVecMultBCSRDense::exec_mkl_impl: MKL backend not available!");
40 template <
typename DT_,
typename IT_>
41 static void exec_cuda_impl(
void* workspace, DT_ * r,
const DT_ alpha,
const DT_ *
const x,
const DT_ *
const y,
const DT_ *
const val,
const IT_ *
const col_idx,
const IT_ *
const row_ptr,
const Index rows,
const Index cols,
const Index nonzeros,
const int block_height,
const int block_width,
const bool transposed);
43 template <
typename DT_,
typename IT_,
int block_height_,
int block_w
idth_,
bool transposed_>
50 if constexpr (transposed_)
57 exec_generic_transpose_impl<DT_, IT_, block_height_, block_width_>(r_view.
get_w(), alpha, x_view.
get_r(), y_view.
get_r(), a_view.
get_r(),
58 ci_view.
get_r(), rp_view.
get_r(), rows, cols, nonzeros);
63 ci_view.
get_r(), rp_view.
get_r(), rows, cols, nonzeros);
73 exec_generic_impl<DT_, IT_, block_height_, block_width_>(r_view.
get_w(), alpha, x_view.
get_r(), y_view.
get_r(), a_view.
get_r(),
74 ci_view.
get_r(), rp_view.
get_r(), rows, cols, nonzeros);
79 ci_view.
get_r(), rp_view.
get_r(), rows, cols, nonzeros);
84 template<
typename DT_,
int block_size_>
85 static void exec_mkl(
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 Index rows,
const Index cols,
const Index nonzeros,
const bool transposed)
96 ci_view.
get_r(), rp_view.
get_r(), rows, cols, nonzeros, block_size_, transposed);
100 exec_mkl_impl(r_view.
get_w(), alpha, x_view.
get_r(), (DT_*)
nullptr, a_view.
get_r(),
101 ci_view.
get_r(), rp_view.
get_r(), rows, cols, nonzeros, block_size_, transposed);
105 template<
typename DT_,
typename IT_,
int block_height_,
int block_w
idth_>
106 static void exec_cuda(
void* workspace,
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 Index rows,
const Index cols,
const Index nonzeros,
const bool transposed)
116 exec_cuda_impl(workspace, r_view.
get_w(), alpha, x_view.
get_r(), y_view.
get_r(), a_view.
get_r(),
117 ci_view.
get_r(), rp_view.
get_r(), rows, cols, nonzeros, block_height_, block_width_, transposed);
121 exec_cuda_impl(workspace, r_view.
get_w(), alpha, x_view.
get_r(), (DT_*)
nullptr, a_view.
get_r(),
122 ci_view.
get_r(), rp_view.
get_r(), rows, cols, nonzeros, block_height_, block_width_, transposed);
126 template<
typename DT_,
typename IT_,
int block_height_,
int block_w
idth_,
bool transposed_>
127 static void exec([[maybe_unused]] std::array<std::shared_ptr<void>,
to_underlying(BackendIdx::num_backends)>& workspaces,
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 Index rows,
const Index cols,
const Index nonzeros)
134 exec_generic<DT_, IT_, block_height_, block_width_, transposed_>(r, alpha, x, y, a, col_idx, row_ptr, rows, cols, nonzeros);
139 if constexpr((block_height_ == block_width_) && (
sizeof(IT_) ==
sizeof(
Index)))
140 exec_mkl<DT_, block_height_>(r, alpha, x, y, a, col_idx, row_ptr, rows, cols, nonzeros, transposed_);
144 exec_generic<DT_, IT_, block_height_, block_width_, transposed_>(r, alpha, x, y, a, col_idx, row_ptr, rows, cols, nonzeros);
147 XABORTM(
"LAFEM::Arch::MatVecMultBCSRDense::exec: MKL backend not available!");
153 exec_cuda<DT_, IT_, block_height_, block_width_>(workspaces[
to_underlying(BackendIdx::cuda)].get(), r, alpha, x, y, a, col_idx, row_ptr, rows, cols, nonzeros, transposed_);
155 XABORTM(
"LAFEM::Arch::MatVecMultBCSRDense::exec: CUDA backend not available!");
160 XABORTM(
"LAFEM::Arch::MatVecMultBCSRDense::exec: unknown backend!");
176 template <
typename DT_,
typename IT_>
181 extern template void MatVecMultBCSRDense::exec_generic_impl<float, std::uint32_t, 1, 1>(
Tiny::Vector<float, 1>*,
const float,
const Tiny::Vector<float, 1> *
const,
const Tiny::Vector<float, 1> *
const,
const Tiny::Matrix<float, 1, 1>*
const,
const std::uint32_t *
const,
const std::uint32_t *
const,
const Index,
const Index,
const Index);
182 extern template void MatVecMultBCSRDense::exec_generic_impl<float, std::uint64_t, 1, 1>(
Tiny::Vector<float, 1>*,
const float,
const Tiny::Vector<float, 1> *
const,
const Tiny::Vector<float, 1> *
const,
const Tiny::Matrix<float, 1, 1>*
const,
const std::uint64_t *
const,
const std::uint64_t *
const,
const Index,
const Index,
const Index);
183 extern template void MatVecMultBCSRDense::exec_generic_impl<float, std::uint32_t, 2, 1>(
Tiny::Vector<float, 2>*,
const float,
const Tiny::Vector<float, 1> *
const,
const Tiny::Vector<float, 2> *
const,
const Tiny::Matrix<float, 2, 1>*
const,
const std::uint32_t *
const,
const std::uint32_t *
const,
const Index,
const Index,
const Index);
184 extern template void MatVecMultBCSRDense::exec_generic_impl<float, std::uint64_t, 2, 1>(
Tiny::Vector<float, 2>*,
const float,
const Tiny::Vector<float, 1> *
const,
const Tiny::Vector<float, 2> *
const,
const Tiny::Matrix<float, 2, 1>*
const,
const std::uint64_t *
const,
const std::uint64_t *
const,
const Index,
const Index,
const Index);
185 extern template void MatVecMultBCSRDense::exec_generic_impl<float, std::uint32_t, 3, 1>(
Tiny::Vector<float, 3>*,
const float,
const Tiny::Vector<float, 1> *
const,
const Tiny::Vector<float, 3> *
const,
const Tiny::Matrix<float, 3, 1>*
const,
const std::uint32_t *
const,
const std::uint32_t *
const,
const Index,
const Index,
const Index);
186 extern template void MatVecMultBCSRDense::exec_generic_impl<float, std::uint64_t, 3, 1>(
Tiny::Vector<float, 3>*,
const float,
const Tiny::Vector<float, 1> *
const,
const Tiny::Vector<float, 3> *
const,
const Tiny::Matrix<float, 3, 1>*
const,
const std::uint64_t *
const,
const std::uint64_t *
const,
const Index,
const Index,
const Index);
187 extern template void MatVecMultBCSRDense::exec_generic_impl<float, std::uint32_t, 4, 1>(
Tiny::Vector<float, 4>*,
const float,
const Tiny::Vector<float, 1> *
const,
const Tiny::Vector<float, 4> *
const,
const Tiny::Matrix<float, 4, 1>*
const,
const std::uint32_t *
const,
const std::uint32_t *
const,
const Index,
const Index,
const Index);
188 extern template void MatVecMultBCSRDense::exec_generic_impl<float, std::uint64_t, 4, 1>(
Tiny::Vector<float, 4>*,
const float,
const Tiny::Vector<float, 1> *
const,
const Tiny::Vector<float, 4> *
const,
const Tiny::Matrix<float, 4, 1>*
const,
const std::uint64_t *
const,
const std::uint64_t *
const,
const Index,
const Index,
const Index);
189 extern template void MatVecMultBCSRDense::exec_generic_impl<float, std::uint32_t, 1, 2>(
Tiny::Vector<float, 1>*,
const float,
const Tiny::Vector<float, 2> *
const,
const Tiny::Vector<float, 1> *
const,
const Tiny::Matrix<float, 1, 2>*
const,
const std::uint32_t *
const,
const std::uint32_t *
const,
const Index,
const Index,
const Index);
190 extern template void MatVecMultBCSRDense::exec_generic_impl<float, std::uint64_t, 1, 2>(
Tiny::Vector<float, 1>*,
const float,
const Tiny::Vector<float, 2> *
const,
const Tiny::Vector<float, 1> *
const,
const Tiny::Matrix<float, 1, 2>*
const,
const std::uint64_t *
const,
const std::uint64_t *
const,
const Index,
const Index,
const Index);
191 extern template void MatVecMultBCSRDense::exec_generic_impl<float, std::uint32_t, 2, 2>(
Tiny::Vector<float, 2>*,
const float,
const Tiny::Vector<float, 2> *
const,
const Tiny::Vector<float, 2> *
const,
const Tiny::Matrix<float, 2, 2>*
const,
const std::uint32_t *
const,
const std::uint32_t *
const,
const Index,
const Index,
const Index);
192 extern template void MatVecMultBCSRDense::exec_generic_impl<float, std::uint64_t, 2, 2>(
Tiny::Vector<float, 2>*,
const float,
const Tiny::Vector<float, 2> *
const,
const Tiny::Vector<float, 2> *
const,
const Tiny::Matrix<float, 2, 2>*
const,
const std::uint64_t *
const,
const std::uint64_t *
const,
const Index,
const Index,
const Index);
193 extern template void MatVecMultBCSRDense::exec_generic_impl<float, std::uint32_t, 3, 2>(
Tiny::Vector<float, 3>*,
const float,
const Tiny::Vector<float, 2> *
const,
const Tiny::Vector<float, 3> *
const,
const Tiny::Matrix<float, 3, 2>*
const,
const std::uint32_t *
const,
const std::uint32_t *
const,
const Index,
const Index,
const Index);
194 extern template void MatVecMultBCSRDense::exec_generic_impl<float, std::uint64_t, 3, 2>(
Tiny::Vector<float, 3>*,
const float,
const Tiny::Vector<float, 2> *
const,
const Tiny::Vector<float, 3> *
const,
const Tiny::Matrix<float, 3, 2>*
const,
const std::uint64_t *
const,
const std::uint64_t *
const,
const Index,
const Index,
const Index);
195 extern template void MatVecMultBCSRDense::exec_generic_impl<float, std::uint32_t, 4, 2>(
Tiny::Vector<float, 4>*,
const float,
const Tiny::Vector<float, 2> *
const,
const Tiny::Vector<float, 4> *
const,
const Tiny::Matrix<float, 4, 2>*
const,
const std::uint32_t *
const,
const std::uint32_t *
const,
const Index,
const Index,
const Index);
196 extern template void MatVecMultBCSRDense::exec_generic_impl<float, std::uint64_t, 4, 2>(
Tiny::Vector<float, 4>*,
const float,
const Tiny::Vector<float, 2> *
const,
const Tiny::Vector<float, 4> *
const,
const Tiny::Matrix<float, 4, 2>*
const,
const std::uint64_t *
const,
const std::uint64_t *
const,
const Index,
const Index,
const Index);
197 extern template void MatVecMultBCSRDense::exec_generic_impl<float, std::uint32_t, 1, 3>(
Tiny::Vector<float, 1>*,
const float,
const Tiny::Vector<float, 3> *
const,
const Tiny::Vector<float, 1> *
const,
const Tiny::Matrix<float, 1, 3>*
const,
const std::uint32_t *
const,
const std::uint32_t *
const,
const Index,
const Index,
const Index);
198 extern template void MatVecMultBCSRDense::exec_generic_impl<float, std::uint64_t, 1, 3>(
Tiny::Vector<float, 1>*,
const float,
const Tiny::Vector<float, 3> *
const,
const Tiny::Vector<float, 1> *
const,
const Tiny::Matrix<float, 1, 3>*
const,
const std::uint64_t *
const,
const std::uint64_t *
const,
const Index,
const Index,
const Index);
199 extern template void MatVecMultBCSRDense::exec_generic_impl<float, std::uint32_t, 2, 3>(
Tiny::Vector<float, 2>*,
const float,
const Tiny::Vector<float, 3> *
const,
const Tiny::Vector<float, 2> *
const,
const Tiny::Matrix<float, 2, 3>*
const,
const std::uint32_t *
const,
const std::uint32_t *
const,
const Index,
const Index,
const Index);
200 extern template void MatVecMultBCSRDense::exec_generic_impl<float, std::uint64_t, 2, 3>(
Tiny::Vector<float, 2>*,
const float,
const Tiny::Vector<float, 3> *
const,
const Tiny::Vector<float, 2> *
const,
const Tiny::Matrix<float, 2, 3>*
const,
const std::uint64_t *
const,
const std::uint64_t *
const,
const Index,
const Index,
const Index);
201 extern template void MatVecMultBCSRDense::exec_generic_impl<float, std::uint32_t, 3, 3>(
Tiny::Vector<float, 3>*,
const float,
const Tiny::Vector<float, 3> *
const,
const Tiny::Vector<float, 3> *
const,
const Tiny::Matrix<float, 3, 3>*
const,
const std::uint32_t *
const,
const std::uint32_t *
const,
const Index,
const Index,
const Index);
202 extern template void MatVecMultBCSRDense::exec_generic_impl<float, std::uint64_t, 3, 3>(
Tiny::Vector<float, 3>*,
const float,
const Tiny::Vector<float, 3> *
const,
const Tiny::Vector<float, 3> *
const,
const Tiny::Matrix<float, 3, 3>*
const,
const std::uint64_t *
const,
const std::uint64_t *
const,
const Index,
const Index,
const Index);
203 extern template void MatVecMultBCSRDense::exec_generic_impl<float, std::uint32_t, 4, 3>(
Tiny::Vector<float, 4>*,
const float,
const Tiny::Vector<float, 3> *
const,
const Tiny::Vector<float, 4> *
const,
const Tiny::Matrix<float, 4, 3>*
const,
const std::uint32_t *
const,
const std::uint32_t *
const,
const Index,
const Index,
const Index);
204 extern template void MatVecMultBCSRDense::exec_generic_impl<float, std::uint64_t, 4, 3>(
Tiny::Vector<float, 4>*,
const float,
const Tiny::Vector<float, 3> *
const,
const Tiny::Vector<float, 4> *
const,
const Tiny::Matrix<float, 4, 3>*
const,
const std::uint64_t *
const,
const std::uint64_t *
const,
const Index,
const Index,
const Index);
205 extern template void MatVecMultBCSRDense::exec_generic_impl<float, std::uint32_t, 1, 4>(
Tiny::Vector<float, 1>*,
const float,
const Tiny::Vector<float, 4> *
const,
const Tiny::Vector<float, 1> *
const,
const Tiny::Matrix<float, 1, 4>*
const,
const std::uint32_t *
const,
const std::uint32_t *
const,
const Index,
const Index,
const Index);
206 extern template void MatVecMultBCSRDense::exec_generic_impl<float, std::uint64_t, 1, 4>(
Tiny::Vector<float, 1>*,
const float,
const Tiny::Vector<float, 4> *
const,
const Tiny::Vector<float, 1> *
const,
const Tiny::Matrix<float, 1, 4>*
const,
const std::uint64_t *
const,
const std::uint64_t *
const,
const Index,
const Index,
const Index);
207 extern template void MatVecMultBCSRDense::exec_generic_impl<float, std::uint32_t, 2, 4>(
Tiny::Vector<float, 2>*,
const float,
const Tiny::Vector<float, 4> *
const,
const Tiny::Vector<float, 2> *
const,
const Tiny::Matrix<float, 2, 4>*
const,
const std::uint32_t *
const,
const std::uint32_t *
const,
const Index,
const Index,
const Index);
208 extern template void MatVecMultBCSRDense::exec_generic_impl<float, std::uint64_t, 2, 4>(
Tiny::Vector<float, 2>*,
const float,
const Tiny::Vector<float, 4> *
const,
const Tiny::Vector<float, 2> *
const,
const Tiny::Matrix<float, 2, 4>*
const,
const std::uint64_t *
const,
const std::uint64_t *
const,
const Index,
const Index,
const Index);
209 extern template void MatVecMultBCSRDense::exec_generic_impl<float, std::uint32_t, 3, 4>(
Tiny::Vector<float, 3>*,
const float,
const Tiny::Vector<float, 4> *
const,
const Tiny::Vector<float, 3> *
const,
const Tiny::Matrix<float, 3, 4>*
const,
const std::uint32_t *
const,
const std::uint32_t *
const,
const Index,
const Index,
const Index);
210 extern template void MatVecMultBCSRDense::exec_generic_impl<float, std::uint64_t, 3, 4>(
Tiny::Vector<float, 3>*,
const float,
const Tiny::Vector<float, 4> *
const,
const Tiny::Vector<float, 3> *
const,
const Tiny::Matrix<float, 3, 4>*
const,
const std::uint64_t *
const,
const std::uint64_t *
const,
const Index,
const Index,
const Index);
211 extern template void MatVecMultBCSRDense::exec_generic_impl<float, std::uint32_t, 4, 4>(
Tiny::Vector<float, 4>*,
const float,
const Tiny::Vector<float, 4> *
const,
const Tiny::Vector<float, 4> *
const,
const Tiny::Matrix<float, 4, 4>*
const,
const std::uint32_t *
const,
const std::uint32_t *
const,
const Index,
const Index,
const Index);
212 extern template void MatVecMultBCSRDense::exec_generic_impl<float, std::uint64_t, 4, 4>(
Tiny::Vector<float, 4>*,
const float,
const Tiny::Vector<float, 4> *
const,
const Tiny::Vector<float, 4> *
const,
const Tiny::Matrix<float, 4, 4>*
const,
const std::uint64_t *
const,
const std::uint64_t *
const,
const Index,
const Index,
const Index);
213 extern template void MatVecMultBCSRDense::exec_generic_impl<double, std::uint32_t, 1, 1>(
Tiny::Vector<double, 1>*,
const double,
const Tiny::Vector<double, 1> *
const,
const Tiny::Vector<double, 1> *
const,
const Tiny::Matrix<double, 1, 1>*
const,
const std::uint32_t *
const,
const std::uint32_t *
const,
const Index,
const Index,
const Index);
214 extern template void MatVecMultBCSRDense::exec_generic_impl<double, std::uint64_t, 1, 1>(
Tiny::Vector<double, 1>*,
const double,
const Tiny::Vector<double, 1> *
const,
const Tiny::Vector<double, 1> *
const,
const Tiny::Matrix<double, 1, 1>*
const,
const std::uint64_t *
const,
const std::uint64_t *
const,
const Index,
const Index,
const Index);
215 extern template void MatVecMultBCSRDense::exec_generic_impl<double, std::uint32_t, 2, 1>(
Tiny::Vector<double, 2>*,
const double,
const Tiny::Vector<double, 1> *
const,
const Tiny::Vector<double, 2> *
const,
const Tiny::Matrix<double, 2, 1>*
const,
const std::uint32_t *
const,
const std::uint32_t *
const,
const Index,
const Index,
const Index);
216 extern template void MatVecMultBCSRDense::exec_generic_impl<double, std::uint64_t, 2, 1>(
Tiny::Vector<double, 2>*,
const double,
const Tiny::Vector<double, 1> *
const,
const Tiny::Vector<double, 2> *
const,
const Tiny::Matrix<double, 2, 1>*
const,
const std::uint64_t *
const,
const std::uint64_t *
const,
const Index,
const Index,
const Index);
217 extern template void MatVecMultBCSRDense::exec_generic_impl<double, std::uint32_t, 3, 1>(
Tiny::Vector<double, 3>*,
const double,
const Tiny::Vector<double, 1> *
const,
const Tiny::Vector<double, 3> *
const,
const Tiny::Matrix<double, 3, 1>*
const,
const std::uint32_t *
const,
const std::uint32_t *
const,
const Index,
const Index,
const Index);
218 extern template void MatVecMultBCSRDense::exec_generic_impl<double, std::uint64_t, 3, 1>(
Tiny::Vector<double, 3>*,
const double,
const Tiny::Vector<double, 1> *
const,
const Tiny::Vector<double, 3> *
const,
const Tiny::Matrix<double, 3, 1>*
const,
const std::uint64_t *
const,
const std::uint64_t *
const,
const Index,
const Index,
const Index);
219 extern template void MatVecMultBCSRDense::exec_generic_impl<double, std::uint32_t, 4, 1>(
Tiny::Vector<double, 4>*,
const double,
const Tiny::Vector<double, 1> *
const,
const Tiny::Vector<double, 4> *
const,
const Tiny::Matrix<double, 4, 1>*
const,
const std::uint32_t *
const,
const std::uint32_t *
const,
const Index,
const Index,
const Index);
220 extern template void MatVecMultBCSRDense::exec_generic_impl<double, std::uint64_t, 4, 1>(
Tiny::Vector<double, 4>*,
const double,
const Tiny::Vector<double, 1> *
const,
const Tiny::Vector<double, 4> *
const,
const Tiny::Matrix<double, 4, 1>*
const,
const std::uint64_t *
const,
const std::uint64_t *
const,
const Index,
const Index,
const Index);
221 extern template void MatVecMultBCSRDense::exec_generic_impl<double, std::uint32_t, 1, 2>(
Tiny::Vector<double, 1>*,
const double,
const Tiny::Vector<double, 2> *
const,
const Tiny::Vector<double, 1> *
const,
const Tiny::Matrix<double, 1, 2>*
const,
const std::uint32_t *
const,
const std::uint32_t *
const,
const Index,
const Index,
const Index);
222 extern template void MatVecMultBCSRDense::exec_generic_impl<double, std::uint64_t, 1, 2>(
Tiny::Vector<double, 1>*,
const double,
const Tiny::Vector<double, 2> *
const,
const Tiny::Vector<double, 1> *
const,
const Tiny::Matrix<double, 1, 2>*
const,
const std::uint64_t *
const,
const std::uint64_t *
const,
const Index,
const Index,
const Index);
223 extern template void MatVecMultBCSRDense::exec_generic_impl<double, std::uint32_t, 2, 2>(
Tiny::Vector<double, 2>*,
const double,
const Tiny::Vector<double, 2> *
const,
const Tiny::Vector<double, 2> *
const,
const Tiny::Matrix<double, 2, 2>*
const,
const std::uint32_t *
const,
const std::uint32_t *
const,
const Index,
const Index,
const Index);
224 extern template void MatVecMultBCSRDense::exec_generic_impl<double, std::uint64_t, 2, 2>(
Tiny::Vector<double, 2>*,
const double,
const Tiny::Vector<double, 2> *
const,
const Tiny::Vector<double, 2> *
const,
const Tiny::Matrix<double, 2, 2>*
const,
const std::uint64_t *
const,
const std::uint64_t *
const,
const Index,
const Index,
const Index);
225 extern template void MatVecMultBCSRDense::exec_generic_impl<double, std::uint32_t, 3, 2>(
Tiny::Vector<double, 3>*,
const double,
const Tiny::Vector<double, 2> *
const,
const Tiny::Vector<double, 3> *
const,
const Tiny::Matrix<double, 3, 2>*
const,
const std::uint32_t *
const,
const std::uint32_t *
const,
const Index,
const Index,
const Index);
226 extern template void MatVecMultBCSRDense::exec_generic_impl<double, std::uint64_t, 3, 2>(
Tiny::Vector<double, 3>*,
const double,
const Tiny::Vector<double, 2> *
const,
const Tiny::Vector<double, 3> *
const,
const Tiny::Matrix<double, 3, 2>*
const,
const std::uint64_t *
const,
const std::uint64_t *
const,
const Index,
const Index,
const Index);
227 extern template void MatVecMultBCSRDense::exec_generic_impl<double, std::uint32_t, 4, 2>(
Tiny::Vector<double, 4>*,
const double,
const Tiny::Vector<double, 2> *
const,
const Tiny::Vector<double, 4> *
const,
const Tiny::Matrix<double, 4, 2>*
const,
const std::uint32_t *
const,
const std::uint32_t *
const,
const Index,
const Index,
const Index);
228 extern template void MatVecMultBCSRDense::exec_generic_impl<double, std::uint64_t, 4, 2>(
Tiny::Vector<double, 4>*,
const double,
const Tiny::Vector<double, 2> *
const,
const Tiny::Vector<double, 4> *
const,
const Tiny::Matrix<double, 4, 2>*
const,
const std::uint64_t *
const,
const std::uint64_t *
const,
const Index,
const Index,
const Index);
229 extern template void MatVecMultBCSRDense::exec_generic_impl<double, std::uint32_t, 1, 3>(
Tiny::Vector<double, 1>*,
const double,
const Tiny::Vector<double, 3> *
const,
const Tiny::Vector<double, 1> *
const,
const Tiny::Matrix<double, 1, 3>*
const,
const std::uint32_t *
const,
const std::uint32_t *
const,
const Index,
const Index,
const Index);
230 extern template void MatVecMultBCSRDense::exec_generic_impl<double, std::uint64_t, 1, 3>(
Tiny::Vector<double, 1>*,
const double,
const Tiny::Vector<double, 3> *
const,
const Tiny::Vector<double, 1> *
const,
const Tiny::Matrix<double, 1, 3>*
const,
const std::uint64_t *
const,
const std::uint64_t *
const,
const Index,
const Index,
const Index);
231 extern template void MatVecMultBCSRDense::exec_generic_impl<double, std::uint32_t, 2, 3>(
Tiny::Vector<double, 2>*,
const double,
const Tiny::Vector<double, 3> *
const,
const Tiny::Vector<double, 2> *
const,
const Tiny::Matrix<double, 2, 3>*
const,
const std::uint32_t *
const,
const std::uint32_t *
const,
const Index,
const Index,
const Index);
232 extern template void MatVecMultBCSRDense::exec_generic_impl<double, std::uint64_t, 2, 3>(
Tiny::Vector<double, 2>*,
const double,
const Tiny::Vector<double, 3> *
const,
const Tiny::Vector<double, 2> *
const,
const Tiny::Matrix<double, 2, 3>*
const,
const std::uint64_t *
const,
const std::uint64_t *
const,
const Index,
const Index,
const Index);
233 extern template void MatVecMultBCSRDense::exec_generic_impl<double, std::uint32_t, 3, 3>(
Tiny::Vector<double, 3>*,
const double,
const Tiny::Vector<double, 3> *
const,
const Tiny::Vector<double, 3> *
const,
const Tiny::Matrix<double, 3, 3>*
const,
const std::uint32_t *
const,
const std::uint32_t *
const,
const Index,
const Index,
const Index);
234 extern template void MatVecMultBCSRDense::exec_generic_impl<double, std::uint64_t, 3, 3>(
Tiny::Vector<double, 3>*,
const double,
const Tiny::Vector<double, 3> *
const,
const Tiny::Vector<double, 3> *
const,
const Tiny::Matrix<double, 3, 3>*
const,
const std::uint64_t *
const,
const std::uint64_t *
const,
const Index,
const Index,
const Index);
235 extern template void MatVecMultBCSRDense::exec_generic_impl<double, std::uint32_t, 4, 3>(
Tiny::Vector<double, 4>*,
const double,
const Tiny::Vector<double, 3> *
const,
const Tiny::Vector<double, 4> *
const,
const Tiny::Matrix<double, 4, 3>*
const,
const std::uint32_t *
const,
const std::uint32_t *
const,
const Index,
const Index,
const Index);
236 extern template void MatVecMultBCSRDense::exec_generic_impl<double, std::uint64_t, 4, 3>(
Tiny::Vector<double, 4>*,
const double,
const Tiny::Vector<double, 3> *
const,
const Tiny::Vector<double, 4> *
const,
const Tiny::Matrix<double, 4, 3>*
const,
const std::uint64_t *
const,
const std::uint64_t *
const,
const Index,
const Index,
const Index);
237 extern template void MatVecMultBCSRDense::exec_generic_impl<double, std::uint32_t, 1, 4>(
Tiny::Vector<double, 1>*,
const double,
const Tiny::Vector<double, 4> *
const,
const Tiny::Vector<double, 1> *
const,
const Tiny::Matrix<double, 1, 4>*
const,
const std::uint32_t *
const,
const std::uint32_t *
const,
const Index,
const Index,
const Index);
238 extern template void MatVecMultBCSRDense::exec_generic_impl<double, std::uint64_t, 1, 4>(
Tiny::Vector<double, 1>*,
const double,
const Tiny::Vector<double, 4> *
const,
const Tiny::Vector<double, 1> *
const,
const Tiny::Matrix<double, 1, 4>*
const,
const std::uint64_t *
const,
const std::uint64_t *
const,
const Index,
const Index,
const Index);
239 extern template void MatVecMultBCSRDense::exec_generic_impl<double, std::uint32_t, 2, 4>(
Tiny::Vector<double, 2>*,
const double,
const Tiny::Vector<double, 4> *
const,
const Tiny::Vector<double, 2> *
const,
const Tiny::Matrix<double, 2, 4>*
const,
const std::uint32_t *
const,
const std::uint32_t *
const,
const Index,
const Index,
const Index);
240 extern template void MatVecMultBCSRDense::exec_generic_impl<double, std::uint64_t, 2, 4>(
Tiny::Vector<double, 2>*,
const double,
const Tiny::Vector<double, 4> *
const,
const Tiny::Vector<double, 2> *
const,
const Tiny::Matrix<double, 2, 4>*
const,
const std::uint64_t *
const,
const std::uint64_t *
const,
const Index,
const Index,
const Index);
241 extern template void MatVecMultBCSRDense::exec_generic_impl<double, std::uint32_t, 3, 4>(
Tiny::Vector<double, 3>*,
const double,
const Tiny::Vector<double, 4> *
const,
const Tiny::Vector<double, 3> *
const,
const Tiny::Matrix<double, 3, 4>*
const,
const std::uint32_t *
const,
const std::uint32_t *
const,
const Index,
const Index,
const Index);
242 extern template void MatVecMultBCSRDense::exec_generic_impl<double, std::uint64_t, 3, 4>(
Tiny::Vector<double, 3>*,
const double,
const Tiny::Vector<double, 4> *
const,
const Tiny::Vector<double, 3> *
const,
const Tiny::Matrix<double, 3, 4>*
const,
const std::uint64_t *
const,
const std::uint64_t *
const,
const Index,
const Index,
const Index);
243 extern template void MatVecMultBCSRDense::exec_generic_impl<double, std::uint32_t, 4, 4>(
Tiny::Vector<double, 4>*,
const double,
const Tiny::Vector<double, 4> *
const,
const Tiny::Vector<double, 4> *
const,
const Tiny::Matrix<double, 4, 4>*
const,
const std::uint32_t *
const,
const std::uint32_t *
const,
const Index,
const Index,
const Index);
244 extern template void MatVecMultBCSRDense::exec_generic_impl<double, std::uint64_t, 4, 4>(
Tiny::Vector<double, 4>*,
const double,
const Tiny::Vector<double, 4> *
const,
const Tiny::Vector<double, 4> *
const,
const Tiny::Matrix<double, 4, 4>*
const,
const std::uint64_t *
const,
const std::uint64_t *
const,
const Index,
const Index,
const Index);
249#define KERNEL_LAFEM_ARCH_MATVECMULT_BCSR_DENSE_HPP 1
250#include <kernel/lafem/arch/matvecmult_bcsr_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.
Tiny Matrix class template.
Tiny Vector class template.
@ overlap
explicitly allow overlapping writes (see Overlapping Memory Views)
@ write
write-only access (see attention note above)
constexpr auto to_underlying(E e) noexcept
Cast enum to underlying type.
std::uint64_t Index
Index data type.
r[i] <- y[i] + alpha * sum_{j=0..n-1} A[i][j] * x[j]
static void init_workspace_cuda(std::shared_ptr< void > &workspace, const Memory::Arbiter &val, const Memory::Arbiter &col_idx, const Memory::Arbiter &row_ptr, const Index rows, const Index cols, const Index nonzeros, const int block_height, const int block_width, const bool transposed)
Sets up a persistent cuSPARSE SpMV/BSRMV workspace for this matrix.