Cholla 3.0.1-dev
Cholla - Massively parallel hydro on GPUs
Loading...
Searching...
No Matches
Static Public Member Functions | Static Public Attributes | List of all members
utils::bimap_detail::FNV1aHasher< MaxKeyLen > Struct Template Reference

#include <FrozenKeyIdxBiMap.h>

Static Public Member Functions

static std::optional< HashRsltPackcalc (const char *key)
 
static std::optional< HashRsltPackcalc (std::string_view key)
 

Static Public Attributes

static constexpr uint32_t FNV1A_PRIME = 16777619
 
static constexpr uint32_t FNV1A_OFFSET = 2166136261
 

Detailed Description

template<int MaxKeyLen = std::numeric_limits<std::uint16_t>::max()>
struct utils::bimap_detail::FNV1aHasher< MaxKeyLen >

collects methods for computing a key's length and 32-bit FNV-1a hash.

Template Parameters
MaxKeyLenthe max number of characters in key (excluding '\0'). By default, it's the largest value HashRsltPack::keylen holds. A smaller value can be specified as an optimization.
Note
This hash function prioritizes convenience. We may want to evaluate whether alternatives (e.g. fxhash) are faster or have fewer collisions with our typical keys.

Member Function Documentation

◆ calc()

template<int MaxKeyLen = std::numeric_limits<std::uint16_t>::max()>
static std::optional< HashRsltPack > utils::bimap_detail::FNV1aHasher< MaxKeyLen >::calc ( const char *  key)
inlinestatic

Calculate the hash value

Parameters
keythe null-terminated string. Behavior is deliberately undefined when passed a nullptr

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