HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PrefixSum.h File Reference

Multi-threaded implementations of inclusive prefix sum. More...

#include "Range.h"
#include <vector>
#include <functional>
+ Include dependency graph for PrefixSum.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 nanovdb
 

Functions

template<typename T , typename OpT = std::plus<T>>
nanovdb::prefixSum (std::vector< T > &vec, bool threaded=true, OpT op=OpT())
 Computes inclusive prefix sum of a vector. More...
 
template<typename T , typename Op >
void nanovdb::inclusiveScan (T *array, size_t size, const T &identity, bool threaded, Op op)
 An inclusive scan includes in[i] when computing out[i]. More...
 

Detailed Description

Multi-threaded implementations of inclusive prefix sum.

Author
Ken Museth
Date
March 12, 2023
Note
An exclusive prefix sum is simply an array starting with zero followed by the elements in the inclusive prefix sum, minus its last entry which is the sum of all the input elements.

Definition in file PrefixSum.h.