Template Struct PhiloxState

Struct Documentation

template<class Arch, std::uint8_t N, std::uint8_t W, std::uint8_t R>
struct PhiloxState

Public Types

using word_type = std::conditional_t<W == 32, std::uint32_t, std::uint64_t>
using counter_type = std::array<word_type, N>
using key_type = std::array<word_type, N / 2>
using result_type = std::uint64_t
using simd_type = xsimd::batch<word_type, Arch>

Public Functions

inline explicit PhiloxState(const key_type &key, const counter_type &counter) noexcept
inline void populate_cache(std::array<result_type, CACHE_SIZE> &cache) noexcept
inline counter_type getCounter(bool prev, std::uint16_t cache_index) const noexcept
inline counter_type getRawCounter() const noexcept
inline key_type getKey() const noexcept
inline void setState(const counter_type &ctr, const key_type &key) noexcept

Public Members

counter_type m_counter
key_type m_key

Public Static Attributes

static constexpr auto RESULTS_PER_BLOCK = std::uint8_t{N * W / 64}
static constexpr std::uint8_t SIMD_WIDTH = std::uint8_t{simd_type::size}
static constexpr std::uint16_t CACHE_SIZE = 256
static constexpr std::uint16_t BLOCKS_PER_CACHE = CACHE_SIZE / RESULTS_PER_BLOCK
static constexpr std::uint16_t BATCHES_PER_CACHE = SIMD_WIDTH == 0 ? 1 : BLOCKS_PER_CACHE / SIMD_WIDTH