53 #ifndef ROCRAND_THREEFRY4X64_20_H_
54 #define ROCRAND_THREEFRY4X64_20_H_
57 #define FQUALIFIERS __forceinline__ __device__
60 #include "rocrand/rocrand_threefry4_impl.h"
62 namespace rocrand_device
65 class threefry4x64_20_engine :
public threefry_engine4_base<ulonglong4, unsigned long long, 20>
68 typedef threefry_engine4_base<ulonglong4, unsigned long long, 20>::threefry_state_4
69 threefry4x64_20_state;
76 FQUALIFIERS threefry4x64_20_engine(
const unsigned long long seed = 0,
77 const unsigned long long subsequence = 0,
78 const unsigned long long offset = 0)
80 this->seed(seed, subsequence, offset);
88 FQUALIFIERS void seed(
const unsigned long long seed = 0,
89 const unsigned long long subsequence = 0,
90 const unsigned long long offset = 0)
92 m_state.counter = {0ULL, 0ULL, 0ULL, 0ULL};
93 m_state.key = {seed, seed >> 16, seed >> 32, seed >> 48};
94 m_state.result = {0ULL, 0ULL, 0ULL, 0ULL};
97 this->discard_subsequence_impl(subsequence);
98 this->discard(offset);
99 m_state.result = this->threefry_rounds(m_state.counter, m_state.key);
106 typedef rocrand_device::threefry4x64_20_engine rocrand_state_threefry4x64_20;
120 const unsigned long long subsequence,
121 const unsigned long long offset,
122 rocrand_state_threefry4x64_20* state)
124 *state = rocrand_state_threefry4x64_20(seed, subsequence, offset);
143 return state->next();
160 return state->next4();
FQUALIFIERS unsigned int rocrand(rocrand_state_lfsr113 *state)
Returns uniformly distributed random unsigned int value from [0; 2^32 - 1] range.
Definition: rocrand_lfsr113.h:253
FQUALIFIERS void rocrand_init(const uint4 seed, const unsigned int subsequence, rocrand_state_lfsr113 *state)
Initializes LFSR113 state.
Definition: rocrand_lfsr113.h:235
FQUALIFIERS uint4 rocrand4(rocrand_state_philox4x32_10 *state)
Returns four uniformly distributed random unsigned int values from [0; 2^32 - 1] range.
Definition: rocrand_philox4x32_10.h:410
#define FQUALIFIERS
Shorthand for commonly used function qualifiers.
Definition: rocrand_uniform.h:31