OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
ParallelReduceTools.h File Reference
#include <utility>
#include <variant>
Include dependency graph for ParallelReduceTools.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ParticleBinning::ArrayReduction< SizeType, IndexType, N >
 A templated structure for performing array-based reductions in parallel computations. More...
 
struct  ParticleBinning::ReductionVariantHelper< SizeType, IndexType, std::integer_sequence< IndexType, Sizes... > >
 Specialized template that expands std::integer_sequence to create a variant of ArrayReduction types. More...
 
struct  ParticleBinning::HostArrayReduction< SizeType, IndexType >
 Host-only array reduction structure for dynamic array sizes in Kokkos::parallel_reduce. More...
 
struct  Kokkos::reduction_identity< ParticleBinning::ArrayReduction< SizeType, IndexType, N > >
 Kokkos reduction identity specialization for custom reduction types. More...
 
struct  Kokkos::reduction_identity< ParticleBinning::HostArrayReduction< SizeType, IndexType > >
 Kokkos reduction identity specialization for host-only HostArrayReduction types. More...
 

Namespaces

namespace  ParticleBinning
 
namespace  Kokkos
 

Typedefs

template<typename SizeType , typename IndexType >
using ParticleBinning::ReductionVariant = typename ReductionVariantHelper< SizeType, IndexType, std::make_integer_sequence< IndexType, maxArrSize< IndexType > > >::type
 Type alias for a std::variant containing all possible ArrayReduction types up to maxArrSize.
 

Enumerations

enum class  ParticleBinning::HistoReductionMode { ParticleBinning::Standard , ParticleBinning::ParallelReduce , ParticleBinning::TeamBased , ParticleBinning::HostOnly }
 

Functions

template<typename SizeType , typename IndexType , IndexType N>
ReductionVariant< SizeType, IndexType > ParticleBinning::createReductionObjectHelper (IndexType binCount)
 Recursive helper function to create ArrayReduction objects with compile-time size matching.
 
template<typename SizeType , typename IndexType >
ReductionVariant< SizeType, IndexType > ParticleBinning::createReductionObject (IndexType binCount)
 Factory function to create ArrayReduction objects with runtime-specified size.
 
template<typename T , unsigned Dim>
T ParticleBinning::vnorm (const VField_t< T, Dim > &field, int p=2)
 Computes the (p)-norm of a vector field (for debugging purpose).
 

Variables

template<typename IndexType >
constexpr IndexType ParticleBinning::maxArrSize = 5
 Maximum allowed array size for compile-time array reduction types.
 

Class Documentation

◆ ParticleBinning::ReductionVariantHelper< SizeType, IndexType, std::integer_sequence< IndexType, Sizes... > >

struct ParticleBinning::ReductionVariantHelper< SizeType, IndexType, std::integer_sequence< IndexType, Sizes... > >
template<typename SizeType, typename IndexType, IndexType... Sizes>
struct ParticleBinning::ReductionVariantHelper< SizeType, IndexType, std::integer_sequence< IndexType, Sizes... > >

Specialized template that expands std::integer_sequence to create a variant of ArrayReduction types.

This specialization takes a std::integer_sequence and expands it into a std::variant containing ArrayReduction types with consecutive sizes. Each size in the sequence is incremented by 1 to create ArrayReduction<SizeType, IndexType, Sizes + 1>.

Template Parameters
SizeTypeThe type used for array elements in the reduction operations.
IndexTypeThe type used for array indexing.
Sizes...Parameter pack of integer values from the std::integer_sequence.

Definition at line 121 of file ParallelReduceTools.h.

Collaboration diagram for ParticleBinning::ReductionVariantHelper< SizeType, IndexType, std::integer_sequence< IndexType, Sizes... > >:
Collaboration graph
Class Members
typedef variant< ArrayReduction< SizeType, IndexType, Sizes+1 >... > type