Tpetra parallel linear algebra
Version of the Day
|
Functor for checking whether a FixedHashTable has one or more duplicate entries. More...
#include <Tpetra_Details_FixedHashTable_def.hpp>
Public Member Functions | |
CheckForDuplicateKeys (const pairs_view_type &pairs, const offsets_view_type &ptr) | |
Constructor. More... | |
KOKKOS_INLINE_FUNCTION void | init (value_type &dst) const |
Set the initial value of the reduction result. More... | |
KOKKOS_INLINE_FUNCTION void | join (value_type &dst, const value_type &src) const |
Combine two intermediate reduction results. More... | |
KOKKOS_INLINE_FUNCTION void | operator() (const size_type &i, value_type &dst) const |
Parallel loop body. More... | |
Functor for checking whether a FixedHashTable has one or more duplicate entries.
OffsetsViewType | Type of the Kokkos::View specialization used to store the "row" offsets; input of this functor. |
PairsViewType | Type of the Kokkos::View specialization used to store the (key,value) pairs in the FixedHashTable; input of this functor. |
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. |
This functor works by iterating over all the hash "buckets" (the entries of ptr
). For each i, all the keys in the (key,value) pairs in the half-exclusive range ptr[i], ptr[i+1] must have the same hash value. Thus, any duplicate keys must be in that range; if the hash function is actually a function, it's impossible to find duplicate keys elsewhere.
If the hash function isn't actually a function, the above algorithm won't work. However, users are not (currently) allowed to supply arbitrary hash functions to Tpetra, so we don't have to worry about checking the hash function here.
Definition at line 427 of file Tpetra_Details_FixedHashTable_def.hpp.
|
inline |
Constructor.
pairs | [in] View of the FixedHashTable's (key,value) pairs |
ptr | [in] View of the FixedHashTable's "bucket" offsets |
Definition at line 442 of file Tpetra_Details_FixedHashTable_def.hpp.
|
inline |
Set the initial value of the reduction result.
Definition at line 452 of file Tpetra_Details_FixedHashTable_def.hpp.
|
inline |
Combine two intermediate reduction results.
Definition at line 459 of file Tpetra_Details_FixedHashTable_def.hpp.
|
inline |
Parallel loop body.
Definition at line 467 of file Tpetra_Details_FixedHashTable_def.hpp.