8#ifndef KERNEL_LAFEM_ARCH_ROW_NORM2_BCSR_HPP
9#error "Do not include this implementation-only header file directly!"
12#include <kernel/util/math.hpp>
14namespace FEAT::LAFEM::Arch
16 template <
typename DT_,
typename IT_>
17 void RowNorm2BCSR::exec_generic_impl(DT_* row_norms,
const DT_*
const val,
const IT_*
const ,
18 const IT_*
const row_ptr,
const Index rows,
const int bh,
const int bw,
const bool squared)
23 FEAT_PRAGMA_OMP(parallel
for)
24 for (
Index row = 0; row < rows; row++)
26 Index end = row_ptr[row + 1];
28 for(
Index i = 0; i < block_height; ++i)
30 row_norms[block_height*row + i] = DT_(0);
33 for (
Index k = row_ptr[row]; k < end; ++k)
36 for(
Index i = 0; i < block_height; ++i)
38 for(
Index j = 0; j < block_width; ++j)
40 row_norms[block_height*row + i] +=
Math::sqr(val[block_height*block_width*k + i*block_width + j]);
44 row_norms[block_height*row + i] =
Math::sqrt(row_norms[block_height*row + i]);
T_ sqrt(T_ x)
Returns the square-root of a value.
T_ sqr(T_ x)
Returns the square of a value.
std::uint64_t Index
Index data type.