vSMC
vSMC: Scalable Monte Carlo
Classes | Namespaces | Macros | Typedefs | Functions
philox.hpp File Reference
#include <vsmc/rng/internal/common.hpp>
#include <vsmc/rng/counter.hpp>

Go to the source code of this file.

Classes

class  vsmc::internal::PhiloxBumpKey< T, K, N, bool >
 
class  vsmc::internal::PhiloxBumpKey< T, 2, N, true >
 
class  vsmc::internal::PhiloxBumpKey< T, 4, N, true >
 
class  vsmc::internal::PhiloxRound< T, K, N, bool >
 
class  vsmc::internal::PhiloxRound< T, 2, N, true >
 
class  vsmc::internal::PhiloxRound< T, 4, N, true >
 
class  vsmc::internal::PhiloxRoundConstant< typename, size_t, size_t >
 
class  vsmc::internal::PhiloxRoundConstant< std::uint32_t, 2, 0 >
 
class  vsmc::internal::PhiloxRoundConstant< std::uint32_t, 4, 0 >
 
class  vsmc::internal::PhiloxRoundConstant< std::uint32_t, 4, 1 >
 
class  vsmc::internal::PhiloxRoundConstant< std::uint64_t, 2, 0 >
 
class  vsmc::internal::PhiloxRoundConstant< std::uint64_t, 4, 0 >
 
class  vsmc::internal::PhiloxRoundConstant< std::uint64_t, 4, 1 >
 
class  vsmc::internal::PhiloxWeylConstant< typename, size_t >
 
class  vsmc::internal::PhiloxWeylConstant< std::uint32_t, 0 >
 
class  vsmc::internal::PhiloxWeylConstant< std::uint32_t, 1 >
 
class  vsmc::internal::PhiloxWeylConstant< std::uint64_t, 0 >
 
class  vsmc::internal::PhiloxWeylConstant< std::uint64_t, 1 >
 
class  vsmc::PhiloxGenerator< ResultType, K, Rounds >
 Philox RNG generator. More...
 

Namespaces

 vsmc
 
 vsmc::internal
 

Macros

#define VSMC_DEFINE_RNG_PHILOX_ROUND_CONSTANT(T, K, I, val)
 
#define VSMC_DEFINE_RNG_PHILOX_WELY_CONSTANT(T, I, val)
 
#define VSMC_RNG_PHILOX_ROUNDS   10
 PhiloxGenerator default rounds. More...
 
#define VSMC_RNG_PHILOX_VECTOR_LENGTH   4
 PhiloxGenerator default vector length. More...
 
#define VSMC_STATIC_ASSERT_RNG_PHILOX
 
#define VSMC_STATIC_ASSERT_RNG_PHILOX_RESULT_TYPE(ResultType)
 
#define VSMC_STATIC_ASSERT_RNG_PHILOX_SIZE(K)
 

Typedefs

using vsmc::Philox = PhiloxEngine< std::uint32_t >
 The default 32-bits Philox engine. More...
 
using vsmc::Philox2x32 = PhiloxEngine< std::uint32_t, 2 >
 Philox2x32 RNG engine. More...
 
using vsmc::Philox2x64 = PhiloxEngine< std::uint64_t, 2 >
 Philox2x64 RNG engine. More...
 
using vsmc::Philox4x32 = PhiloxEngine< std::uint32_t, 4 >
 Philox4x32 RNG engine. More...
 
using vsmc::Philox4x64 = PhiloxEngine< std::uint64_t, 4 >
 Philox4x64 RNG engine. More...
 
using vsmc::Philox_64 = PhiloxEngine< std::uint64_t >
 The default 64-bits Philox engine. More...
 
template<typename ResultType , std::size_t K = 4, std::size_t Rounds = 10>
using vsmc::PhiloxEngine = CounterEngine< PhiloxGenerator< ResultType, K, Rounds >>
 Philox RNG engine. More...
 

Functions

template<std::size_t K, std::size_t I>
void vsmc::internal::philox_hilo (std::uint32_t b, std::uint32_t &hi, std::uint32_t &lo)
 
template<std::size_t K, std::size_t I>
void vsmc::internal::philox_hilo (std::uint64_t b, std::uint64_t &hi, std::uint64_t &lo)
 

Macro Definition Documentation

#define VSMC_DEFINE_RNG_PHILOX_ROUND_CONSTANT (   T,
  K,
  I,
  val 
)
Value:
template <> \
class PhiloxRoundConstant<T, K, I> \
: public std::integral_constant<T, val> \
{ \
};

Definition at line 64 of file philox.hpp.

#define VSMC_DEFINE_RNG_PHILOX_WELY_CONSTANT (   T,
  I,
  val 
)
Value:
template <> \
class PhiloxWeylConstant<T, I> : public std::integral_constant<T, val> \
{ \
};

Definition at line 58 of file philox.hpp.

#define VSMC_STATIC_ASSERT_RNG_PHILOX
Value:
VSMC_STATIC_ASSERT_RNG_PHILOX_SIZE(K);
#define VSMC_STATIC_ASSERT_RNG_PHILOX_RESULT_TYPE(ResultType)
Definition: philox.hpp:42

Definition at line 54 of file philox.hpp.

#define VSMC_STATIC_ASSERT_RNG_PHILOX_RESULT_TYPE (   ResultType)
Value:
VSMC_STATIC_ASSERT(((sizeof(ResultType) == sizeof(std::uint32_t) && \
std::is_unsigned<ResultType>::value) || \
(sizeof(ResultType) == sizeof(std::uint64_t) && \
std::is_unsigned<ResultType>::value)), \
"**PhiloxGenerator** USED WITH ResultType OTHER THAN UNSIGNED 32/64 " \
"BITS INTEGER")
uint uint32_t
Definition: opencl.h:39
ulong uint64_t
Definition: opencl.h:40
#define VSMC_STATIC_ASSERT(cond, msg)
Definition: assert.hpp:42

Definition at line 42 of file philox.hpp.

#define VSMC_STATIC_ASSERT_RNG_PHILOX_SIZE (   K)
Value:
VSMC_STATIC_ASSERT((K == 2 || K == 4), \
"**PhiloxGenerator** USED WITH SIZE OTHER THAN 2 OR 4")
#define VSMC_STATIC_ASSERT(cond, msg)
Definition: assert.hpp:42

Definition at line 50 of file philox.hpp.