Tpetra parallel linear algebra
Version of the Day
|
Parallel reduce functor for filling the FixedHashTable, and computing the min and max keys. More...
#include <Tpetra_Details_FixedHashTable_def.hpp>
Public Member Functions | |
FillPairs (const pairs_view_type &pairs, const counts_view_type &counts, const offsets_view_type &ptr, const keys_view_type &keys, const typename pair_type::second_type startingValue) | |
Constructor. More... | |
FillPairs (const pairs_view_type &pairs, const counts_view_type &counts, const offsets_view_type &ptr, const keys_view_type &keys, const typename pair_type::second_type startingValue, const key_type initMinKey, const key_type initMaxKey) | |
Constructor that takes initial min and max key values. More... | |
KOKKOS_INLINE_FUNCTION void | init (value_type &dst) const |
Set the initial value of the reduction result. More... | |
KOKKOS_INLINE_FUNCTION void | operator() (const size_type &i, value_type &dst) const |
Parallel loop body; do this for every entry of keys_ . More... | |
Parallel reduce functor for filling the FixedHashTable, and computing the min and max keys.
This is also a parallel reduce functor in order to check for failure. Failure should only happen on a bug (in CountBuckets or computeOffsetsFromCounts), but checking for it is cheap and easy.
PairsViewType | Type of the Kokkos::View specialization used to store the (key,value) pairs in the FixedHashTable; output of this functor. |
KeysViewType | Type of the Kokkos::View specialization used to store the keys; input of this functor. |
CountsViewType | Type of the Kokkos::View specialization used to store the bucket counts; input of this functor, used as scratch space (so it must be nonconst; offsets_view_type is the const version of this). |
SizeType | The parallel loop index type; a built-in integer type. Defaults to the type of the input View's dimension. You may use a shorter type to improve performance. |
Definition at line 245 of file Tpetra_Details_FixedHashTable_def.hpp.
|
inline |
Constructor.
pairs | [out] (Preallocated) View of (key,value) pairs |
counts | [in/out] View of bucket counts; overwritten as scratch space |
ptr | [in] View of offsets |
keys | [in] View of the keys |
startingValue | [in] Starting value. For each key keys[i], the corresponding value (in the (key,value) pair) is startingValue + i. |
Definition at line 280 of file Tpetra_Details_FixedHashTable_def.hpp.
|
inline |
Constructor that takes initial min and max key values.
This constructor is useful for Tpetra::Map's noncontiguous constructor. That constructor first harvests an initial sequence of contiguous global indices, then puts any remaining global indices that follow into the hash table. That initial sequence defines initial min and max keys.
pairs | [out] (Preallocated) View of (key,value) pairs |
counts | [in/out] View of bucket counts; overwritten as scratch space |
ptr | [in] View of offsets |
keys | [in] View of the keys |
startingValue | [in] Starting value. For each key keys[i], the corresponding value (in the (key,value) pair) is startingValue + i. |
initMinKey | [in] Initial min key value |
initMaxKey | [in] Initial max key value |
Definition at line 315 of file Tpetra_Details_FixedHashTable_def.hpp.
|
inline |
Set the initial value of the reduction result.
Definition at line 333 of file Tpetra_Details_FixedHashTable_def.hpp.
|
inline |
Parallel loop body; do this for every entry of keys_
.
Add (key = keys_[i], value = startingValue_ + i) pair to the hash table. Compute min and max key value.
Definition at line 358 of file Tpetra_Details_FixedHashTable_def.hpp.