vSMC  v3.0.0
Scalable Monte Carlo
rng_define_macro.hpp
Go to the documentation of this file.
1 //============================================================================
2 // vSMC/include/rng/internal/rng_define_macro.hpp
3 //----------------------------------------------------------------------------
4 // vSMC: Scalable Monte Carlo
5 //----------------------------------------------------------------------------
6 // Copyright (c) 2013-2016, Yan Zhou
7 // All rights reserved.
8 //
9 // Redistribution and use in source and binary forms, with or without
10 // modification, are permitted provided that the following conditions are met:
11 //
12 // Redistributions of source code must retain the above copyright notice,
13 // this list of conditions and the following disclaimer.
14 //
15 // Redistributions in binary form must reproduce the above copyright notice,
16 // this list of conditions and the following disclaimer in the documentation
17 // and/or other materials provided with the distribution.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS
20 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 // POSSIBILITY OF SUCH DAMAGE.
30 //============================================================================
31 
32 #ifndef VSMC_RNG_DEFINE_MACRO_NA
33 #define VSMC_RNG_DEFINE_MACRO_NA(RNGType, Name, name)
34 #endif
35 
36 VSMC_RNG_DEFINE_MACRO(::vsmc::Philox2x32, Philox2x32, philox2x32)
37 VSMC_RNG_DEFINE_MACRO(::vsmc::Philox4x32, Philox4x32, philox4x32)
38 VSMC_RNG_DEFINE_MACRO(::vsmc::Philox2x64, Philox2x64, philox2x64)
39 VSMC_RNG_DEFINE_MACRO(::vsmc::Philox4x64, Philox4x64, philox4x64)
40 VSMC_RNG_DEFINE_MACRO(::vsmc::Philox2x32_64, Philox2x32_64, philox2x32_64)
41 VSMC_RNG_DEFINE_MACRO(::vsmc::Philox4x32_64, Philox4x32_64, philox4x32_64)
42 VSMC_RNG_DEFINE_MACRO(::vsmc::Philox2x64_64, Philox2x64_64, philox2x64_64)
43 VSMC_RNG_DEFINE_MACRO(::vsmc::Philox4x64_64, Philox4x64_64, philox4x64_64)
44 
45 VSMC_RNG_DEFINE_MACRO(::vsmc::Threefry2x32, Threefry2x32, threefry2x32)
46 VSMC_RNG_DEFINE_MACRO(::vsmc::Threefry4x32, Threefry4x32, threefry4x32)
47 VSMC_RNG_DEFINE_MACRO(::vsmc::Threefry2x64, Threefry2x64, threefry2x64)
48 VSMC_RNG_DEFINE_MACRO(::vsmc::Threefry4x64, Threefry4x64, threefry4x64)
49 VSMC_RNG_DEFINE_MACRO(::vsmc::Threefry8x64, Threefry8x64, threefry8x64)
50 VSMC_RNG_DEFINE_MACRO(::vsmc::Threefry16x64, Threefry16x64, threefry16x64)
51 VSMC_RNG_DEFINE_MACRO(
52  ::vsmc::Threefry2x32_64, Threefry2x32_64, threefry2x32_64)
53 VSMC_RNG_DEFINE_MACRO(
54  ::vsmc::Threefry4x32_64, Threefry4x32_64, threefry4x32_64)
55 VSMC_RNG_DEFINE_MACRO(
56  ::vsmc::Threefry2x64_64, Threefry2x64_64, threefry2x64_64)
57 VSMC_RNG_DEFINE_MACRO(
58  ::vsmc::Threefry4x64_64, Threefry4x64_64, threefry4x64_64)
59 VSMC_RNG_DEFINE_MACRO(
60  ::vsmc::Threefry8x64_64, Threefry8x64_64, threefry8x64_64)
61 VSMC_RNG_DEFINE_MACRO(
62  ::vsmc::Threefry16x64_64, Threefry16x64_64, threefry16x64_64)
63 
64 #if VSMC_HAS_AES_NI
65 #define VSMC_RNG_DEFINE_MACRO_AES_NI VSMC_RNG_DEFINE_MACRO
66 #else
67 #define VSMC_RNG_DEFINE_MACRO_AES_NI VSMC_RNG_DEFINE_MACRO_NA
68 #endif
69 
71 VSMC_RNG_DEFINE_MACRO_AES_NI(::vsmc::AES128x2, AES128x2, aes128x2)
72 VSMC_RNG_DEFINE_MACRO_AES_NI(::vsmc::AES128x4, AES128x4, aes128x4)
73 VSMC_RNG_DEFINE_MACRO_AES_NI(::vsmc::AES128x8, AES128x8, aes128x8)
74 VSMC_RNG_DEFINE_MACRO_AES_NI(::vsmc::AES128x1_64, AES128x1_64, aes128x1_64)
75 VSMC_RNG_DEFINE_MACRO_AES_NI(::vsmc::AES128x2_64, AES128x2_64, aes128x2_64)
76 VSMC_RNG_DEFINE_MACRO_AES_NI(::vsmc::AES128x4_64, AES128x4_64, aes128x4_64)
77 VSMC_RNG_DEFINE_MACRO_AES_NI(::vsmc::AES128x8_64, AES128x8_64, aes128x8_64)
78 
79 VSMC_RNG_DEFINE_MACRO_AES_NI(::vsmc::AES192x1, AES192x1, aes192x1)
80 VSMC_RNG_DEFINE_MACRO_AES_NI(::vsmc::AES192x2, AES192x2, aes192x2)
81 VSMC_RNG_DEFINE_MACRO_AES_NI(::vsmc::AES192x4, AES192x4, aes192x4)
82 VSMC_RNG_DEFINE_MACRO_AES_NI(::vsmc::AES192x8, AES192x8, aes192x8)
83 VSMC_RNG_DEFINE_MACRO_AES_NI(::vsmc::AES192x1_64, AES192x1_64, aes192x1_64)
84 VSMC_RNG_DEFINE_MACRO_AES_NI(::vsmc::AES192x2_64, AES192x2_64, aes192x2_64)
85 VSMC_RNG_DEFINE_MACRO_AES_NI(::vsmc::AES192x4_64, AES192x4_64, aes192x4_64)
86 VSMC_RNG_DEFINE_MACRO_AES_NI(::vsmc::AES192x8_64, AES192x8_64, aes192x8_64)
87 
88 VSMC_RNG_DEFINE_MACRO_AES_NI(::vsmc::AES256x1, AES256x1, aes256x1)
89 VSMC_RNG_DEFINE_MACRO_AES_NI(::vsmc::AES256x2, AES256x2, aes256x2)
90 VSMC_RNG_DEFINE_MACRO_AES_NI(::vsmc::AES256x4, AES256x4, aes256x4)
91 VSMC_RNG_DEFINE_MACRO_AES_NI(::vsmc::AES256x8, AES256x8, aes256x8)
92 VSMC_RNG_DEFINE_MACRO_AES_NI(::vsmc::AES256x1_64, AES256x1_64, aes256x1_64)
93 VSMC_RNG_DEFINE_MACRO_AES_NI(::vsmc::AES256x2_64, AES256x2_64, aes256x2_64)
94 VSMC_RNG_DEFINE_MACRO_AES_NI(::vsmc::AES256x4_64, AES256x4_64, aes256x4_64)
95 VSMC_RNG_DEFINE_MACRO_AES_NI(::vsmc::AES256x8_64, AES256x8_64, aes256x8_64)
96 
97 VSMC_RNG_DEFINE_MACRO_AES_NI(::vsmc::ARSx1, ARSx1, arsx1)
98 VSMC_RNG_DEFINE_MACRO_AES_NI(::vsmc::ARSx2, ARSx2, arsx2)
99 VSMC_RNG_DEFINE_MACRO_AES_NI(::vsmc::ARSx4, ARSx4, arsx4)
100 VSMC_RNG_DEFINE_MACRO_AES_NI(::vsmc::ARSx8, ARSx8, arsx8)
101 VSMC_RNG_DEFINE_MACRO_AES_NI(::vsmc::ARSx1_64, ARSx1_64, arsx1_64)
102 VSMC_RNG_DEFINE_MACRO_AES_NI(::vsmc::ARSx2_64, ARSx2_64, arsx2_64)
103 VSMC_RNG_DEFINE_MACRO_AES_NI(::vsmc::ARSx4_64, ARSx4_64, arsx4_64)
104 VSMC_RNG_DEFINE_MACRO_AES_NI(::vsmc::ARSx8_64, ARSx8_64, arsx8_64)
105 
106 #undef VSMC_RNG_DEFINE_MACRO_AES_NI
107 
108 #if VSMC_HAS_RDRAND
109 #define VSMC_RNG_DEFINE_MACRO_RDRAND VSMC_RNG_DEFINE_MACRO
110 #else
111 #define VSMC_RNG_DEFINE_MACRO_RDRAND VSMC_RNG_DEFINE_MACRO_NA
112 #endif
113 
115 VSMC_RNG_DEFINE_MACRO_RDRAND(::vsmc::RDRAND32, RDRAND32, rdrand32)
116 VSMC_RNG_DEFINE_MACRO_RDRAND(::vsmc::RDRAND64, RDRAND64, rdrand64)
117 
118 #undef VSMC_RNG_DEFINE_MACRO_RDRAND
RDRAND generator.
Definition: rdrand.hpp:98
AES192Engine< std::uint32_t, 12, 2 > AES192x2
AES-192 RNG engine with 32-bit integers output, 2 blocks.
Definition: aes_ni.hpp:1096
Definition: monitor.hpp:48
AES128Engine< std::uint64_t, 10, 2 > AES128x2_64
AES-128 RNG engine with 64-bit integers output, 2 blocks.
Definition: aes_ni.hpp:1073
AES256Engine< std::uint64_t, 14, 4 > AES256x4_64
AES-256 RNG engine with 64-bit integers output, 4 blocks.
Definition: aes_ni.hpp:1156
#define VSMC_RNG_DEFINE_MACRO_AES_NI
AES256Engine< std::uint32_t, 14, 8 > AES256x8
AES-256 RNG engine with 32-bit integers output, 8 blocks.
Definition: aes_ni.hpp:1144
AES192Engine< std::uint64_t, 12, 2 > AES192x2_64
AES-192 RNG engine with 64-bit integers output, 2 blocks.
Definition: aes_ni.hpp:1112
AES256Engine< std::uint64_t, 14, 1 > AES256x1_64
AES-256 RNG engine with 64-bit integers output, 1 block.
Definition: aes_ni.hpp:1148
Philox4x32Engine< std::uint64_t > Philox4x32_64
Philox4x32 RNG engine with 64-bit integer output.
Definition: philox.hpp:574
ARSEngine< std::uint32_t, 5, 8 > ARSx8
ARS RNG engine with 32-bit integers output, 8 blocks and default rounds.
Definition: aes_ni.hpp:1188
Philox2x64Engine< std::uint64_t > Philox2x64_64
Philox2x64 RNG engine with 64-bit integer output.
Definition: philox.hpp:578
#define VSMC_RNG_DEFINE_MACRO_RDRAND
Threefry4x32Engine< std::uint64_t > Threefry4x32_64
Threefry4x32 RNG engine with 64-bit integer output.
Definition: threefry.hpp:646
AES192Engine< std::uint64_t, 12, 8 > AES192x8_64
AES-192 RNG engine with 64-bit integers output, 8 blocks.
Definition: aes_ni.hpp:1120
Threefry2x32Engine< std::uint32_t > Threefry2x32
Threefry2x32 RNG engine with 32-bit integer output.
Definition: threefry.hpp:618
AES128Engine< std::uint32_t, 10, 1 > AES128x1
AES-128 RNG engine with 32-bit integers output, 1 block.
Definition: aes_ni.hpp:1053
RDRANDEngine< std::uint64_t > RDRAND64
C++11 Engine using 64-bit RDRAND instruction.
Definition: rdrand.hpp:218
Counter based RNG engine.
Definition: counter.hpp:187
AES128Engine< std::uint32_t, 10, 4 > AES128x4
AES-128 RNG engine with 32-bit integers output, 4 blocks.
Definition: aes_ni.hpp:1061
AES256Engine< std::uint64_t, 14, 8 > AES256x8_64
AES-256 RNG engine with 64-bit integers output, 8 blocks.
Definition: aes_ni.hpp:1160
ARSEngine< std::uint32_t, 5, 2 > ARSx2
ARS RNG engine with 32-bit integers output, 2 blocks and default rounds.
Definition: aes_ni.hpp:1178
AES192Engine< std::uint32_t, 12, 1 > AES192x1
AES-192 RNG engine with 32-bit integers output, 1 block.
Definition: aes_ni.hpp:1092
AES256Engine< std::uint32_t, 14, 2 > AES256x2
AES-256 RNG engine with 32-bit integers output, 2 blocks.
Definition: aes_ni.hpp:1136
ARSEngine< std::uint32_t, 5, 1 > ARSx1
ARS RNG engine with 32-bit integers output, 1 block and default rounds.
Definition: aes_ni.hpp:1173
Threefry8x64Engine< std::uint32_t > Threefry8x64
Threefry8x64 RNG engine with 32-bit integer output.
Definition: threefry.hpp:634
AES192Engine< std::uint64_t, 12, 1 > AES192x1_64
AES-192 RNG engine with 64-bit integers output, 1 block.
Definition: aes_ni.hpp:1108
ARSEngine< std::uint64_t, 5, 4 > ARSx4_64
ARS RNG engine with 64-bit integers output, 4 blocks and default rounds.
Definition: aes_ni.hpp:1203
AES256Engine< std::uint32_t, 14, 4 > AES256x4
AES-256 RNG engine with 32-bit integers output, 4 blocks.
Definition: aes_ni.hpp:1140
Philox4x64Engine< std::uint64_t > Philox4x64_64
Philox4x64 RNG engine with 64-bit integer output.
Definition: philox.hpp:582
AES128Engine< std::uint64_t, 10, 4 > AES128x4_64
AES-128 RNG engine with 64-bit integers output, 4 blocks.
Definition: aes_ni.hpp:1077
Threefry16x64Engine< std::uint64_t > Threefry16x64_64
Threefry16x64 RNG engine with 64-bit integer output.
Definition: threefry.hpp:662
Threefry2x64Engine< std::uint64_t > Threefry2x64_64
Threefry2x64 RNG engine with 64-bit integer output.
Definition: threefry.hpp:650
ARSEngine< std::uint64_t, 5, 2 > ARSx2_64
ARS RNG engine with 64-bit integers output, 2 blocks and default rounds.
Definition: aes_ni.hpp:1198
Threefry8x64Engine< std::uint64_t > Threefry8x64_64
Threefry8x64 RNG engine with 64-bit integer output.
Definition: threefry.hpp:658
Philox2x32Engine< std::uint32_t > Philox2x32
Philox2x32 RNG engine with 32-bit integer output.
Definition: philox.hpp:554
AES256Engine< std::uint64_t, 14, 2 > AES256x2_64
AES-256 RNG engine with 64-bit integers output, 2 blocks.
Definition: aes_ni.hpp:1152
Philox4x32Engine< std::uint32_t > Philox4x32
Philox4x32 RNG engine with 32-bit integer output.
Definition: philox.hpp:558
AES192Engine< std::uint32_t, 12, 4 > AES192x4
AES-192 RNG engine with 32-bit integers output, 4 blocks.
Definition: aes_ni.hpp:1100
Philox2x32Engine< std::uint64_t > Philox2x32_64
Philox2x32 RNG engine with 64-bit integer output.
Definition: philox.hpp:570
ARSEngine< std::uint64_t, 5, 8 > ARSx8_64
ARS RNG engine with 64-bit integers output, 8 blocks and default rounds.
Definition: aes_ni.hpp:1208
ARSEngine< std::uint32_t, 5, 4 > ARSx4
ARS RNG engine with 32-bit integers output, 4 blocks and default rounds.
Definition: aes_ni.hpp:1183
RDRANDEngine< std::uint32_t > RDRAND32
C++11 Engine using 32-bit RDRAND instruction.
Definition: rdrand.hpp:214
Threefry2x64Engine< std::uint32_t > Threefry2x64
Threefry2x64 RNG engine with 32-bit integer output.
Definition: threefry.hpp:626
RDRANDEngine< std::uint16_t > RDRAND16
C++11 Engine using 16-bit RDRAND instruction.
Definition: rdrand.hpp:210
ARSEngine< std::uint64_t, 5, 1 > ARSx1_64
ARS RNG engine with 64-bit integers output, 1 block and default rounds.
Definition: aes_ni.hpp:1193
AES192Engine< std::uint64_t, 12, 4 > AES192x4_64
AES-192 RNG engine with 64-bit integers output, 4 blocks.
Definition: aes_ni.hpp:1116
AES128Engine< std::uint32_t, 10, 2 > AES128x2
AES-128 RNG engine with 32-bit integers output, 2 blocks.
Definition: aes_ni.hpp:1057
Threefry16x64Engine< std::uint32_t > Threefry16x64
Threefry16x64 RNG engine with 32-bit integer output.
Definition: threefry.hpp:638
AES256Engine< std::uint32_t, 14, 1 > AES256x1
AES-256 RNG engine with 32-bit integers output, 1 block.
Definition: aes_ni.hpp:1132
Threefry4x64Engine< std::uint32_t > Threefry4x64
Threefry4x64 RNG engine with 32-bit integer output.
Definition: threefry.hpp:630
Philox2x64Engine< std::uint32_t > Philox2x64
Philox2x64 RNG engine with 32-bit integer output.
Definition: philox.hpp:562
Philox4x64Engine< std::uint32_t > Philox4x64
Philox4x64 RNG engine with 32-bit integer output.
Definition: philox.hpp:566
AES192Engine< std::uint32_t, 12, 8 > AES192x8
AES-192 RNG engine with 32-bit integers output, 8 blocks.
Definition: aes_ni.hpp:1104
AES128Engine< std::uint64_t, 10, 1 > AES128x1_64
AES-128 RNG engine with 64-bit integers output, 1 block.
Definition: aes_ni.hpp:1069
Threefry4x32Engine< std::uint32_t > Threefry4x32
Threefry4x32 RNG engine with 32-bit integer output.
Definition: threefry.hpp:622
Threefry4x64Engine< std::uint64_t > Threefry4x64_64
Threefry4x64 RNG engine with 64-bit integer output.
Definition: threefry.hpp:654
AES128Engine< std::uint64_t, 10, 8 > AES128x8_64
AES-128 RNG engine with 64-bit integers output, 8 blocks.
Definition: aes_ni.hpp:1081
AES128Engine< std::uint32_t, 10, 8 > AES128x8
AES-128 RNG engine with 32-bit integers output, 8 blocks.
Definition: aes_ni.hpp:1065
Threefry2x32Engine< std::uint64_t > Threefry2x32_64
Threefry2x32 RNG engine with 64-bit integer output.
Definition: threefry.hpp:642