53 #ifndef ROCRAND_THREEFRY4X64_20_H_
54 #define ROCRAND_THREEFRY4X64_20_H_
56 #include "rocrand/rocrand_threefry4_impl.h"
58 namespace rocrand_device
61 class threefry4x64_20_engine :
public threefry_engine4_base<ulonglong4, unsigned long long, 20>
64 ROCRAND_DEPRECATED(
"Alias \"threefry4x64_20_state\" is deprecated. Use \"state_type\" instead.")
65 typedef threefry_engine4_base<ulonglong4,
unsigned long long, 20>::threefry_state_4
66 threefry4x64_20_state;
73 __forceinline__ __device__ __host__ threefry4x64_20_engine(const
unsigned long long seed = 0,
74 const
unsigned long long subsequence
76 const
unsigned long long offset = 0)
78 this->seed(seed, subsequence, offset);
86 __forceinline__ __device__ __host__
void seed(
const unsigned long long seed = 0,
87 const unsigned long long subsequence = 0,
88 const unsigned long long offset = 0)
90 m_state.counter = {0ULL, 0ULL, 0ULL, 0ULL};
91 m_state.key = {seed, seed >> 16, seed >> 32, seed >> 48};
92 m_state.result = {0ULL, 0ULL, 0ULL, 0ULL};
95 this->discard_subsequence_impl(subsequence);
96 this->discard(offset);
97 m_state.result = this->threefry_rounds(m_state.counter, m_state.key);
104 typedef rocrand_device::threefry4x64_20_engine rocrand_state_threefry4x64_20;
117 __forceinline__ __device__ __host__
void rocrand_init(
const unsigned long long seed,
118 const unsigned long long subsequence,
119 const unsigned long long offset,
120 rocrand_state_threefry4x64_20* state)
122 *state = rocrand_state_threefry4x64_20(seed, subsequence, offset);
139 __forceinline__ __device__ __host__
unsigned long long rocrand(rocrand_state_threefry4x64_20* state)
141 return state->next();
156 __forceinline__ __device__ __host__ ulonglong4
rocrand4(rocrand_state_threefry4x64_20* state)
158 return state->next4();
__forceinline__ __device__ __host__ void rocrand_init(const uint4 seed, const unsigned int subsequence, rocrand_state_lfsr113 *state)
Initializes LFSR113 state.
Definition: rocrand_lfsr113.h:238
__forceinline__ __device__ __host__ 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:386
__forceinline__ __device__ __host__ unsigned int rocrand(rocrand_state_lfsr113 *state)
Returns uniformly distributed random unsigned int value from [0; 2^32 - 1] range.
Definition: rocrand_lfsr113.h:274