Tpetra parallel linear algebra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Static Public Member Functions | List of all members
Tpetra::Details::Hash< KeyType, DeviceType, OffsetType, int > Struct Template Reference

Specialization for ResultType = int. More...

#include <Tpetra_Details_Hash.hpp>

Public Types

typedef KeyType argument_type
 Type of the hash function's input. More...
 
typedef int result_type
 Type of the return value of the hash function. More...
 
typedef OffsetType offset_type
 Type of offsets into the hash table's array of (key,value) pairs. More...
 

Static Public Member Functions

static KOKKOS_INLINE_FUNCTION
result_type 
hashFunc (const argument_type &key, const offset_type &size)
 The hash function. More...
 
static result_type getRecommendedSize (const offset_type size)
 Number of "buckets" that the constructor of FixedHashTable should allocate. More...
 

Detailed Description

template<class KeyType, class DeviceType, class OffsetType>
struct Tpetra::Details::Hash< KeyType, DeviceType, OffsetType, int >

Specialization for ResultType = int.

Template Parameters
KeyTypeThe type of hash function inputs. Corresponds to Tpetra's GlobalOrdinal type.
DeviceTypeKokkos::Device specialization.
OffsetTypeType of each entry of the "buckets" (offsets) array ptr_ in FixedHashTable.

This hash function currently always returns int, no matter the value type. This is unfortunate, because it limits Tpetra to have LocalOrdinal = int (or smaller). I would like to fix this at some point. Tpetra provides this partial specialization as a hook for fixing this later.

Definition at line 98 of file Tpetra_Details_Hash.hpp.

Member Typedef Documentation

template<class KeyType , class DeviceType , class OffsetType >
typedef KeyType Tpetra::Details::Hash< KeyType, DeviceType, OffsetType, int >::argument_type

Type of the hash function's input.

This is the same typedef as found in std::hash.

Definition at line 102 of file Tpetra_Details_Hash.hpp.

template<class KeyType , class DeviceType , class OffsetType >
typedef int Tpetra::Details::Hash< KeyType, DeviceType, OffsetType, int >::result_type

Type of the return value of the hash function.

This is the same typedef as found in std::hash.

Definition at line 107 of file Tpetra_Details_Hash.hpp.

template<class KeyType , class DeviceType , class OffsetType >
typedef OffsetType Tpetra::Details::Hash< KeyType, DeviceType, OffsetType, int >::offset_type

Type of offsets into the hash table's array of (key,value) pairs.

Definition at line 110 of file Tpetra_Details_Hash.hpp.

Member Function Documentation

template<class KeyType , class DeviceType , class OffsetType >
static KOKKOS_INLINE_FUNCTION result_type Tpetra::Details::Hash< KeyType, DeviceType, OffsetType, int >::hashFunc ( const argument_type key,
const offset_type size 
)
inlinestatic

The hash function.

Parameters
key[in] The key to hash.
size[in] Number of "buckets" in the hash table.

It is legal to call this function in a Kokkos parallel kernel.

Definition at line 119 of file Tpetra_Details_Hash.hpp.

template<class KeyType , class DeviceType , class OffsetType >
static result_type Tpetra::Details::Hash< KeyType, DeviceType, OffsetType, int >::getRecommendedSize ( const offset_type  size)
inlinestatic

Number of "buckets" that the constructor of FixedHashTable should allocate.

Parameters
size[in] Number of entries in the table. (FixedHashTable fixes the number of entries in its constructor.)

Definition at line 144 of file Tpetra_Details_Hash.hpp.


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