NumericAL
A header-only C++20 lexer built on REAL
Loading...
Searching...
No Matches
Static Public Member Functions | Static Public Attributes | List of all members
numerical::detail::pairwise_tree< T > Struct Template Reference

The shape of NumPy's pairwise summation tree over the values of type T: below lanes values summed in order; up to block in lanes interleaved partial sums, added pairwise, then the remainder in order; above, the first half and the rest summed apart. NumPy counts in reals: a real's 8 partial sums and blocks of 128 are a complex number's 4 (its parts side by side) and 64, its half a multiple of 4. More...

#include <tensor.hpp>

Static Public Member Functions

static constexpr std::size_t half (std::size_t count) noexcept
 The first half's length: half of count, less its remainder by 8.
 
static T combine (const T *p, std::size_t width=1)
 The partial sums at p, width apart, added pairwise: its two fours, then the two.
 

Static Public Attributes

static constexpr std::size_t lanes {pairwise_lanes}
 The partial sums.
 
static constexpr std::size_t block {128}
 The most values one block sums.
 

Detailed Description

template<typename T>
struct numerical::detail::pairwise_tree< T >

The shape of NumPy's pairwise summation tree over the values of type T: below lanes values summed in order; up to block in lanes interleaved partial sums, added pairwise, then the remainder in order; above, the first half and the rest summed apart. NumPy counts in reals: a real's 8 partial sums and blocks of 128 are a complex number's 4 (its parts side by side) and 64, its half a multiple of 4.

Definition at line 986 of file tensor.hpp.

Member Function Documentation

◆ combine()

template<typename T >
static T numerical::detail::pairwise_tree< T >::combine ( const T *  p,
std::size_t  width = 1 
)
inlinestatic

The partial sums at p, width apart, added pairwise: its two fours, then the two.

Definition at line 997 of file tensor.hpp.

◆ half()

template<typename T >
static constexpr std::size_t numerical::detail::pairwise_tree< T >::half ( std::size_t  count)
inlinestaticconstexprnoexcept

The first half's length: half of count, less its remainder by 8.

Definition at line 991 of file tensor.hpp.

Member Data Documentation

◆ block

template<typename T >
constexpr std::size_t numerical::detail::pairwise_tree< T >::block {128}
staticconstexpr

The most values one block sums.

Definition at line 988 of file tensor.hpp.

◆ lanes

template<typename T >
constexpr std::size_t numerical::detail::pairwise_tree< T >::lanes {pairwise_lanes}
staticconstexpr

The partial sums.

Definition at line 987 of file tensor.hpp.


The documentation for this struct was generated from the following file: