8#ifndef KERNEL_LAFEM_ARCH_MATVECMULT_BCSR_DENSE_HPP
9#error "Do not include this implementation-only header file directly!"
12namespace FEAT::LAFEM::Arch
14 template <
typename DT_,
typename IT_,
int bh_,
int bw_>
15 void MatVecMultBCSRDense::exec_generic_impl(Tiny::Vector<DT_, bh_> * r,
const DT_ alpha,
const Tiny::Vector<DT_, bw_> *
const x,
16 const Tiny::Vector<DT_, bh_> *
const y,
const Tiny::Matrix<DT_, bh_, bw_>*
const val,
17 const IT_ *
const col_idx,
const IT_ *
const row_ptr,
const Index rows,
const Index ,
const Index)
21 FEAT_PRAGMA_OMP(parallel
for schedule(
static, 2000))
22 for (
Index row = 0 ; row < rows ; ++row)
24 Tiny::Vector<DT_, bh_> bsum(0);
25 const IT_ end(row_ptr[row + 1]);
26 for (IT_ i = row_ptr[row] ; i < end ; ++i)
28 bsum.add_mat_vec_mult(val[i], x[col_idx[i]]);
30 r[row] = y[row] + (alpha * bsum);
35 FEAT_PRAGMA_OMP(parallel
for schedule(
static, 2000))
36 for (
Index row = 0 ; row < rows ; ++row)
38 Tiny::Vector<DT_, bh_> bsum(0);
39 const IT_ end(row_ptr[row + 1]);
40 for (IT_ i = row_ptr[row] ; i < end ; ++i)
42 bsum.add_mat_vec_mult(val[i], x[col_idx[i]]);
44 r[row] = alpha * bsum;
49 template <
typename DT_,
typename IT_,
int bh_,
int bw_>
50 void MatVecMultBCSRDense::exec_generic_transpose_impl(Tiny::Vector<DT_, bw_> * r,
const DT_ alpha,
const Tiny::Vector<DT_, bh_> *
const x,
51 const Tiny::Vector<DT_, bw_> *
const y,
const Tiny::Matrix<DT_, bh_, bw_>*
const val,
52 const IT_ *
const col_idx,
const IT_ *
const row_ptr,
const Index rows,
const Index cols,
const Index)
56 FEAT_PRAGMA_OMP(parallel
for)
57 for (
Index col = 0 ; col < cols ; ++col)
62 else if((r != y) || (alpha != DT_(1)))
64 const DT_ ba = DT_(1) / alpha;
65 FEAT_PRAGMA_OMP(parallel
for)
66 for (
Index col = 0 ; col < cols ; ++col)
72 for (
Index row = 0 ; row < rows ; ++row)
74 for (
Index i(row_ptr[row]) ; i < row_ptr[row+1] ; ++i)
76 r[col_idx[i]].add_vec_mat_mult(x[row], val[i]);
82 FEAT_PRAGMA_OMP(parallel
for)
83 for (
Index col = 0 ; col < cols ; ++col)
85 r[col] = alpha * r[col];
std::uint64_t Index
Index data type.