Tpetra parallel linear algebra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
Tpetra::Details::FHT::CheckForDuplicateKeys< OffsetsViewType, PairsViewType, SizeType > Class Template Reference

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 (volatile value_type &dst, const volatile 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...
 

Detailed Description

template<class OffsetsViewType, class PairsViewType, class SizeType = typename OffsetsViewType::size_type>
class Tpetra::Details::FHT::CheckForDuplicateKeys< OffsetsViewType, PairsViewType, SizeType >

Functor for checking whether a FixedHashTable has one or more duplicate entries.

Template Parameters
OffsetsViewTypeType of the Kokkos::View specialization used to store the "row" offsets; input of this functor.
PairsViewTypeType of the Kokkos::View specialization used to store the (key,value) pairs in the FixedHashTable; input of this functor.
SizeTypeThe 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 461 of file Tpetra_Details_FixedHashTable_def.hpp.

Constructor & Destructor Documentation

template<class OffsetsViewType , class PairsViewType , class SizeType = typename OffsetsViewType::size_type>
Tpetra::Details::FHT::CheckForDuplicateKeys< OffsetsViewType, PairsViewType, SizeType >::CheckForDuplicateKeys ( const pairs_view_type &  pairs,
const offsets_view_type &  ptr 
)
inline

Constructor.

Parameters
pairs[in] View of the FixedHashTable's (key,value) pairs
ptr[in] View of the FixedHashTable's "bucket" offsets

Definition at line 476 of file Tpetra_Details_FixedHashTable_def.hpp.

Member Function Documentation

template<class OffsetsViewType , class PairsViewType , class SizeType = typename OffsetsViewType::size_type>
KOKKOS_INLINE_FUNCTION void Tpetra::Details::FHT::CheckForDuplicateKeys< OffsetsViewType, PairsViewType, SizeType >::init ( value_type &  dst) const
inline

Set the initial value of the reduction result.

Definition at line 486 of file Tpetra_Details_FixedHashTable_def.hpp.

template<class OffsetsViewType , class PairsViewType , class SizeType = typename OffsetsViewType::size_type>
KOKKOS_INLINE_FUNCTION void Tpetra::Details::FHT::CheckForDuplicateKeys< OffsetsViewType, PairsViewType, SizeType >::join ( volatile value_type &  dst,
const volatile value_type &  src 
) const
inline

Combine two intermediate reduction results.

Definition at line 493 of file Tpetra_Details_FixedHashTable_def.hpp.

template<class OffsetsViewType , class PairsViewType , class SizeType = typename OffsetsViewType::size_type>
KOKKOS_INLINE_FUNCTION void Tpetra::Details::FHT::CheckForDuplicateKeys< OffsetsViewType, PairsViewType, SizeType >::operator() ( const size_type &  i,
value_type &  dst 
) const
inline

Parallel loop body.

Definition at line 501 of file Tpetra_Details_FixedHashTable_def.hpp.


The documentation for this class was generated from the following file: