|
OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
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 = 10 |
| 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 237 of file ParallelReduceTools.h.
|
inline |
Default constructor that allocates and zero-initializes the array.
Definition at line 257 of file ParallelReduceTools.h.
References ParticleBinning::HostArrayReduction< SizeType, IndexType >::binCountStatic, and ParticleBinning::HostArrayReduction< SizeType, IndexType >::the_array.
|
inline |
Copy constructor that performs a deep copy of the array from another instance.
| rhs | The instance to copy from. |
Definition at line 269 of file ParallelReduceTools.h.
References ParticleBinning::HostArrayReduction< SizeType, IndexType >::binCountStatic, and ParticleBinning::HostArrayReduction< SizeType, IndexType >::the_array.
|
inline |
Destructor that deallocates the dynamically allocated array.
Definition at line 279 of file ParallelReduceTools.h.
References ParticleBinning::HostArrayReduction< SizeType, IndexType >::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 304 of file ParallelReduceTools.h.
References ParticleBinning::HostArrayReduction< SizeType, IndexType >::binCountStatic, and ParticleBinning::HostArrayReduction< SizeType, IndexType >::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 287 of file ParallelReduceTools.h.
References ParticleBinning::HostArrayReduction< SizeType, IndexType >::binCountStatic, and ParticleBinning::HostArrayReduction< SizeType, IndexType >::the_array.
|
static |
Static variable defining the array size for all instances of this template specialization.
Static member initialization for the array size variable.
This line provides the definition and default initialization for the static member binCountStatic. The default value of 10 serves as a place holder and should be overridden based on the required histogram size.
| SizeType | The type used for array elements. |
| IndexType | The type used for indexing and size specification. |
HostArrayReduction instances. Definition at line 251 of file ParallelReduceTools.h.
Referenced by ParticleBinning::HostArrayReduction< SizeType, IndexType >::HostArrayReduction(), ParticleBinning::HostArrayReduction< SizeType, IndexType >::HostArrayReduction(), ParticleBinning::HostArrayReduction< SizeType, IndexType >::operator+=(), and ParticleBinning::HostArrayReduction< SizeType, IndexType >::operator=().
| SizeType* ParticleBinning::HostArrayReduction< SizeType, IndexType >::the_array |
Pointer to the dynamically allocated array for reduction operations.
Definition at line 241 of file ParallelReduceTools.h.
Referenced by ParticleBinning::HostArrayReduction< SizeType, IndexType >::HostArrayReduction(), ParticleBinning::HostArrayReduction< SizeType, IndexType >::HostArrayReduction(), ParticleBinning::HostArrayReduction< SizeType, IndexType >::operator+=(), ParticleBinning::HostArrayReduction< SizeType, IndexType >::operator=(), TEST_F(), and ParticleBinning::HostArrayReduction< SizeType, IndexType >::~HostArrayReduction().