FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
matvecmult_bcsr_dense.hpp
1// FEAT3: Finite Element Analysis Toolbox, Version 3
2// Copyright (C) 2010 by Stefan Turek & the FEAT group
3// FEAT3 is released under the GNU General Public License version 3,
4// see the file 'copyright.txt' in the top level directory for details.
5
6#pragma once
7
8// includes, FEAT
10#include <kernel/backend.hpp>
11#include <kernel/util/memory_arbiter.hpp>
12#include <kernel/util/tiny_algebra.hpp>
13
14#include <array>
15
16namespace FEAT::LAFEM::Arch
17{
20 {
21 template <typename DT_, typename IT_, int bh_, int bw_>
22 static void exec_generic_impl(Tiny::Vector<DT_, bh_> * r, const DT_ alpha, const Tiny::Vector<DT_, bw_> * const x,
23 const Tiny::Vector<DT_, bh_> * const y, const Tiny::Matrix<DT_, bh_, bw_>* const val,
24 const IT_ * const col_idx, const IT_ * const row_ptr, const Index rows, const Index cols, const Index);
25
26 template <typename DT_, typename IT_, int bh_, int bw_>
27 static void exec_generic_transpose_impl(Tiny::Vector<DT_, bw_> * r, const DT_ alpha, const Tiny::Vector<DT_, bh_> * const x,
28 const Tiny::Vector<DT_, bw_> * const y, const Tiny::Matrix<DT_, bh_, bw_>* const val,
29 const IT_ * const col_idx, const IT_ * const row_ptr, const Index rows, const Index cols, const Index);
30
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);
33
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)
36 {
37 XABORTM("LAFEM::Arch::MatVecMultBCSRDense::exec_mkl_impl: MKL backend not available!");
38 }
39
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);
42
43 template <typename DT_, typename IT_, int block_height_, int block_width_, bool transposed_>
44 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 Index rows, const Index cols, const Index nonzeros)
45 {
49
50 if constexpr (transposed_)
51 {
54 if(y)
55 {
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);
59 }
60 else
61 {
62 exec_generic_transpose_impl<DT_, IT_, block_height_, block_width_>(r_view.get_w(), alpha, x_view.get_r(), (Tiny::Vector<DT_, block_width_>*)nullptr, a_view.get_r(),
63 ci_view.get_r(), rp_view.get_r(), rows, cols, nonzeros);
64 }
65 }
66 else
67 {
70 if(y)
71 {
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);
75 }
76 else
77 {
78 exec_generic_impl<DT_, IT_, block_height_, block_width_>(r_view.get_w(), alpha, x_view.get_r(), (Tiny::Vector<DT_, block_height_>*)nullptr, a_view.get_r(),
79 ci_view.get_r(), rp_view.get_r(), rows, cols, nonzeros);
80 }
81 }
82 }
83
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)
86 {
92 if(y)
93 {
95 exec_mkl_impl(r_view.get_w(), alpha, x_view.get_r(), y_view.get_r(), a_view.get_r(),
96 ci_view.get_r(), rp_view.get_r(), rows, cols, nonzeros, block_size_, transposed);
97 }
98 else
99 {
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);
102 }
103 }
104
105 template<typename DT_, typename IT_, int block_height_, int block_width_>
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)
107 {
108 Memory::TypedView<IT_> rp_view(row_ptr.view(Memory::Location::cuda));
109 Memory::TypedView<IT_> ci_view(col_idx.view(Memory::Location::cuda));
113 if(y)
114 {
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);
118 }
119 else
120 {
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);
123 }
124 }
125
126 template<typename DT_, typename IT_, int block_height_, int block_width_, 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)
128 {
129 XASSERT(r != x);
130
132 {
134 exec_generic<DT_, IT_, block_height_, block_width_, transposed_>(r, alpha, x, y, a, col_idx, row_ptr, rows, cols, nonzeros);
135 break;
136
138#ifdef FEAT_HAVE_MKL
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_);
141 else
142 {
143 Backend::warn_missing("LAFEM::Arch::MatVecMultBCSRDense::exec: non-square blocks");
144 exec_generic<DT_, IT_, block_height_, block_width_, transposed_>(r, alpha, x, y, a, col_idx, row_ptr, rows, cols, nonzeros);
145 }
146#else
147 XABORTM("LAFEM::Arch::MatVecMultBCSRDense::exec: MKL backend not available!");
148#endif
149 break;
150
152#ifdef FEAT_HAVE_CUDA
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_);
154#else
155 XABORTM("LAFEM::Arch::MatVecMultBCSRDense::exec: CUDA backend not available!");
156#endif
157 break;
158
159 default:
160 XABORTM("LAFEM::Arch::MatVecMultBCSRDense::exec: unknown backend!");
161 break;
162 }
163 }
164
176 template <typename DT_, typename IT_>
177 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);
178 };
179
180#ifdef FEAT_EICKT
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);
245#endif
246} // namespace FEAT::LAFEM::Arch
247
248#ifndef __CUDACC__
249#define KERNEL_LAFEM_ARCH_MATVECMULT_BCSR_DENSE_HPP 1
250#include <kernel/lafem/arch/matvecmult_bcsr_dense_generic.hpp>
251#endif
#define XABORTM(msg)
Abortion macro definition with custom message.
Definition: assertion.hpp:192
#define XASSERT(expr)
Assertion macro definition.
Definition: assertion.hpp:262
FEAT Kernel base header.
static PreferredBackend get_preferred_backend()
get current preferred backend
Definition: backend.cpp:32
static void warn_missing(const char *operation, PreferredBackend preferred_backend, PreferredBackend fallback_backend=PreferredBackend::generic)
issues a warning about unsupported backend usage
Definition: backend.cpp:77
Memory arbiter class.
View view(Location mem_loc, Access access)
Maps a raw view to a memory block.
Typed memory view class.
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)
@ read
read-only access
@ 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.