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

Go to the source code of this file.

Classes

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

Namespaces

 vsmc
 

Macros

#define VSMC_RDRAND_NTRIAL_MAX   0
 
#define VSMC_RUNTIME_WARNING_RNG_RDRAND_ENGINE_NTRIAL(ntrial, NTrialMax)
 
#define VSMC_STATIC_ASSERT_RNG_RDRAND_ENGINE   VSMC_STATIC_ASSERT_RNG_RDRAND_ENGINE_RESULT_TYPE(ResultType);
 
#define VSMC_STATIC_ASSERT_RNG_RDRAND_ENGINE_RESULT_TYPE(ResultType)
 

Typedefs

using vsmc::RDRAND16 = RDRANDEngine< std::uint16_t >
 C++11 Engine using 16-bits RDRAND instruction. More...
 
using vsmc::RDRAND32 = RDRANDEngine< std::uint32_t >
 C++11 Engine using 32-bits RDRAND instruction. More...
 
using vsmc::RDRAND64 = RDRANDEngine< std::uint64_t >
 C++11 Engine using 64-bits RDRAND instruction. More...
 

Functions

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

Macro Definition Documentation

#define VSMC_RDRAND_NTRIAL_MAX   0

Definition at line 39 of file rdrand.hpp.

#define VSMC_RUNTIME_WARNING_RNG_RDRAND_ENGINE_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:77

Definition at line 55 of file rdrand.hpp.

#define VSMC_STATIC_ASSERT_RNG_RDRAND_ENGINE   VSMC_STATIC_ASSERT_RNG_RDRAND_ENGINE_RESULT_TYPE(ResultType);

Definition at line 52 of file rdrand.hpp.

#define VSMC_STATIC_ASSERT_RNG_RDRAND_ENGINE_RESULT_TYPE (   ResultType)
Value:
VSMC_STATIC_ASSERT(((sizeof(ResultType) == sizeof(std::uint16_t) && \
std::is_unsigned<ResultType>::value) || \
(sizeof(ResultType) == sizeof(std::uint32_t) && \
std::is_unsigned<ResultType>::value) || \
(sizeof(ResultType) == sizeof(std::uint64_t) && \
std::is_unsigned<ResultType>::value)), \
"**RDRANDEngine** USED WITH ResultType OTHER THAN UNSIGNED 16/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 rdrand.hpp.