Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
Namespaces | Functions
scan_exclusive_sum_in_place.hpp File Reference

In-place exclusive scan (prefix sum) algorithm for device buffers. More...

#include "shambase/aliases_int.hpp"
#include "shamalgs/impl_utils.hpp"
#include "shambackends/DeviceBuffer.hpp"
+ Include dependency graph for scan_exclusive_sum_in_place.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  shamalgs
 namespace to contain everything implemented by shamalgs
 
namespace  shamalgs::primitives
 namespace for primitive algorithm (e.g. sort, scan, reductions, ...)
 
namespace  shamalgs::primitives::impl
 namespace to control implementation behavior
 

Functions

template<class T >
void shamalgs::primitives::scan_exclusive_sum_in_place (sham::DeviceBuffer< T > &buf1, u32 len)
 Compute exclusive prefix sum in-place on a device buffer.
 
std::vector< shamalgs::impl_paramshamalgs::primitives::impl::get_default_impl_list_scan_exclusive_sum_in_place ()
 Get list of available scan_exclusive_sum_in_place implementations.
 
shamalgs::impl_param shamalgs::primitives::impl::get_current_impl_scan_exclusive_sum_in_place ()
 Get the current implementation for scan_exclusive_sum_in_place.
 
void shamalgs::primitives::impl::set_impl_scan_exclusive_sum_in_place (const std::string &impl, const std::string &param="")
 Set the implementation for scan_exclusive_sum_in_place.
 

Detailed Description

In-place exclusive scan (prefix sum) algorithm for device buffers.

Author
Timothée David–Cléris (tim.s.nosp@m.hamr.nosp@m.ock@p.nosp@m.roto.nosp@m.n.me)

This header provides parallel algorithms to compute the exclusive prefix sum of elements in a device buffer. The exclusive scan operation computes for each position i the sum of all elements from index 0 to i-1, with the first element receiving the identity value (0 for addition).

The algorithm performs the operation in-place, modifying the input buffer directly without allocating additional memory for the result. This makes it memory-efficient for large datasets.

Definition in file scan_exclusive_sum_in_place.hpp.