numerics 0.1.0
Loading...
Searching...
No Matches
reduce.cpp File Reference

Implementations for num::kernel::reduce (seq_t and par_t overloads). More...

#include "kernel/reduce.hpp"
#include "kernel/raw.hpp"
#include <cmath>

Go to the source code of this file.

Namespaces

namespace  num
 
namespace  num::kernel
 
namespace  num::kernel::reduce
 

Functions

real num::kernel::reduce::l1_norm (const Vector &x, seq_t) noexcept
 Sequential: calls raw::l1_norm (routes to cblas_dasum when BLAS available; otherwise auto-vectorizable seq loop).
 
real num::kernel::reduce::l1_norm (const Vector &x, par_t)
 Parallel: OMP reduction(+) over abs values; falls back to seq_t when NUMERICS_HAS_OMP is not defined.
 
real num::kernel::reduce::linf_norm (const Vector &x, seq_t) noexcept
 Sequential: calls raw::linf_norm (routes to cblas_idamax when BLAS available; otherwise plain max loop).
 
real num::kernel::reduce::linf_norm (const Vector &x, par_t)
 Parallel: OMP reduction(max) over abs values; falls back to seq_t when NUMERICS_HAS_OMP is not defined.
 
real num::kernel::reduce::sum (const Vector &x, seq_t) noexcept
 Sequential: auto-vectorizable summation loop (no BLAS equivalent).
 
real num::kernel::reduce::sum (const Vector &x, par_t)
 Parallel: OMP reduction(+) over x[i]; falls back to seq_t when NUMERICS_HAS_OMP is not defined.
 

Detailed Description

Implementations for num::kernel::reduce (seq_t and par_t overloads).

seq_t paths delegate to raw::, which internally calls cblas_dasum / cblas_idamax when NUMERICS_HAS_BLAS is defined.

par_t paths use OpenMP reductions. When NUMERICS_HAS_OMP is not defined par_t falls through to the seq_t implementation.

Definition in file reduce.cpp.