FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
scale_row_bcsr_generic.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#ifndef KERNEL_LAFEM_ARCH_SCALE_ROW_BCSR_HPP
9#error "Do not include this implementation-only header file directly!"
10#endif
11
12#include <kernel/util/tiny_algebra.hpp>
13
14namespace FEAT::LAFEM::Arch
15{
16 template <typename DT_, typename IT_>
17 void ScaleRowBCSR::exec_generic_impl(DT_ * r, const DT_ * const a, const IT_ * const /*col_idx*/,
18 const IT_ * const row_ptr, const DT_ * const x, const Index rows, const Index, const Index, const int bh, const int bw)
19 {
20 FEAT_PRAGMA_OMP(parallel for)
21 for (Index i = 0 ; i < rows ; ++i)
22 {
23 const IT_ end(row_ptr[i + 1]);
24 for (IT_ j(row_ptr[i]) ; j < end ; ++j)
25 {
26 for (int h(0) ; h < bh ; ++h)
27 {
28 for (int w(0) ; w < bw ; ++w)
29 {
30 r[j * IT_(bh * bw) + IT_(h * bw + w)] = a[j * IT_(bh * bw) + IT_(h * bw + w)] * x[i*IT_(bh) + IT_(h)];
31 }
32 }
33 }
34 }
35 }
36} // namespace FEAT::LAFEM::Arch
std::uint64_t Index
Index data type.