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

Go to the source code of this file.

Classes

class  vsmc::RDRANDGenerator< ResultType, NTrialMax >
 RDRAND generator. More...
 

Namespaces

 vsmc
 

Macros

#define VSMC_RDRAND_NTRIAL_MAX   10
 
#define VSMC_RUNTIME_WARNING_RNG_RDRAND_GENERATOR_NTRIAL(ntrial, NTrialMax)
 
#define VSMC_STATIC_ASSERT_RNG_RDRAND_GENERATOR   VSMC_STATIC_ASSERT_RNG_RDRAND_GENERATOR_RESULT_TYPE(ResultType);
 
#define VSMC_STATIC_ASSERT_RNG_RDRAND_GENERATOR_RESULT_TYPE(ResultType)
 

Typedefs

typedef GeneratorWrapper< uint16_t, RDRANDGenerator< uint16_t > > vsmc::RDRAND16
 C++11 Engine using 16-bits RDRAND instruction. More...
 
typedef GeneratorWrapper< uint32_t, RDRANDGenerator< uint32_t > > vsmc::RDRAND32
 C++11 Engine using 32-bits RDRAND instruction. More...
 
typedef GeneratorWrapper< uint64_t, RDRANDGenerator< uint64_t > > vsmc::RDRAND64
 C++11 Engine using 64-bits RDRAND instruction. More...
 

Functions

template<typename UIntType >
bool vsmc::rdrand (UIntType *)
 Invoke the RDRAND instruction and return the carry flag. More...
 
template<>
bool vsmc::rdrand< uint16_t > (uint16_t *rand)
 Invoke the 16-bits RDRAND instruction and return the carry flag. More...
 
template<>
bool vsmc::rdrand< uint32_t > (uint32_t *rand)
 Invoke the 32-bits RDRAND instruction and return the carry flag. More...
 
template<>
bool vsmc::rdrand< uint64_t > (uint64_t *rand)
 Invoke the 64-bits RDRAND instruction and return the carry flag. More...
 

Macro Definition Documentation

#define VSMC_RDRAND_NTRIAL_MAX   10

Definition at line 40 of file rdrand.hpp.

#define VSMC_RUNTIME_WARNING_RNG_RDRAND_GENERATOR_NTRIAL (   ntrial,
  NTrialMax 
)
Value:
VSMC_RUNTIME_WARNING((ntrial < NTrialMax), \
("**RDRAND::generate** MAXIMUM NUMBER OF TRIALS EXCEEDED"))
#define VSMC_RUNTIME_WARNING(cond, msg)
Definition: assert.hpp:84

Definition at line 53 of file rdrand.hpp.

#define VSMC_STATIC_ASSERT_RNG_RDRAND_GENERATOR   VSMC_STATIC_ASSERT_RNG_RDRAND_GENERATOR_RESULT_TYPE(ResultType);

Definition at line 50 of file rdrand.hpp.

#define VSMC_STATIC_ASSERT_RNG_RDRAND_GENERATOR_RESULT_TYPE (   ResultType)
Value:
cxx11::is_same<ResultType, uint16_t>::value || \
cxx11::is_same<ResultType, uint32_t>::value || \
cxx11::is_same<ResultType, uint64_t>::value), \
USE_RDRANDGenerator_WITH_RESULT_TYPE_OTHER_THAN_uint16_t_OR_uint32_t_OR_uint64_t)
#define VSMC_STATIC_ASSERT(cond, msg)
Definition: assert.hpp:46

Definition at line 43 of file rdrand.hpp.