|
OPALX (Object Oriented Parallel Accelerator Library for Exascal) MINIorX
OPALX
|
Host-only array reduction structure for dynamic array sizes in Kokkos::parallel_reduce. More...
#include <ParallelReduceTools.h>
Public Member Functions | |
| HostArrayReduction () | |
| Default constructor that allocates and zero-initializes the array. | |
| HostArrayReduction (const HostArrayReduction &rhs) | |
| Copy constructor that performs a deep copy of the array from another instance. | |
| ~HostArrayReduction () | |
| Destructor that deallocates the dynamically allocated array. | |
| HostArrayReduction & | operator= (const HostArrayReduction &rhs) |
| Assignment operator that performs a deep copy of the array from another instance. | |
| HostArrayReduction & | operator+= (const HostArrayReduction &src) |
| Element-wise addition operator that adds the elements of another HostArrayReduction instance. | |
Public Attributes | |
| SizeType * | the_array |
| Pointer to the dynamically allocated array for reduction operations. | |
Static Public Attributes | |
| static IndexType | binCountStatic |
| Static variable defining the array size for all instances of this template specialization. | |
Host-only array reduction structure for dynamic array sizes in Kokkos::parallel_reduce.
This structure provides array-based reduction functionality specifically only for host execution. Unlike ArrayReduction which uses compile-time fixed sizes, HostArrayReduction uses dynamically allocated arrays with runtime-determined sizes. This approach offers better performance than team-based reductions on host systems (low concurrency) while maintaining flexibility for arbitrary bin counts (way more efficient than pure atomics).
| SizeType | The type used for the elements of the array. |
| IndexType | The type used for indexing and array size specification. |
Usage Example (ReducerType is a specialization of HostArrayReduction):
Definition at line 217 of file ParallelReduceTools.h.
|
inline |
Default constructor that allocates and zero-initializes the array.
Definition at line 236 of file ParallelReduceTools.h.
References binCountStatic, and the_array.
Referenced by HostArrayReduction(), operator+=(), and operator=().
|
inline |
Copy constructor that performs a deep copy of the array from another instance.
| rhs | The instance to copy from. |
Definition at line 246 of file ParallelReduceTools.h.
References binCountStatic, HostArrayReduction(), and the_array.
|
inline |
Destructor that deallocates the dynamically allocated array.
Definition at line 254 of file ParallelReduceTools.h.
References the_array.
|
inline |
Element-wise addition operator that adds the elements of another HostArrayReduction instance.
| src | The source instance to add to this instance. |
Definition at line 276 of file ParallelReduceTools.h.
References binCountStatic, HostArrayReduction(), and the_array.
|
inline |
Assignment operator that performs a deep copy of the array from another instance.
| rhs | The instance to copy from. |
Definition at line 262 of file ParallelReduceTools.h.
References binCountStatic, HostArrayReduction(), and the_array.
|
static |
Static variable defining the array size for all instances of this template specialization.
Definition at line 230 of file ParallelReduceTools.h.
Referenced by HostArrayReduction(), HostArrayReduction(), operator+=(), and operator=().
| SizeType* ParticleBinning::HostArrayReduction< SizeType, IndexType >::the_array |
Pointer to the dynamically allocated array for reduction operations.
Definition at line 222 of file ParallelReduceTools.h.
Referenced by HostArrayReduction(), HostArrayReduction(), operator+=(), operator=(), and ~HostArrayReduction().