11 #ifndef EIGEN_CXX11_TENSOR_TENSOR_RANDOM_H
12 #define EIGEN_CXX11_TENSOR_TENSOR_RANDOM_H
20 #if defined(EIGEN_GPU_COMPILE_PHASE)
28 return random<uint64_t>();
36 *
state = current * 6364136223846793005ULL + (
stream << 1 | 1);
38 return static_cast<unsigned>((current ^ (current >> 22)) >> (22 + (current >> 61)));
42 seed = seed ? seed : get_random_seed();
43 return seed * 6364136223846793005ULL + 0xda3e39cb94b95bdbULL;
52 return static_cast<T>(rnd);
85 const unsigned rnd = PCG_XSH_RS_generator(
state,
stream);
86 result.raw = rnd & 0x7fffffu;
103 unsigned rnd1 = PCG_XSH_RS_generator(
state,
stream) & 0xfffffu;
105 unsigned rnd2 = PCG_XSH_RS_generator(
state,
stream);
131 m_state = PCG_XSH_RS_state(seed);
132 #ifdef EIGEN_USE_SYCL
152 #ifdef EIGEN_USE_SYCL
153 m_exec_once =
other.m_exec_once;
159 #ifdef EIGEN_USE_SYCL
163 m_state += (
i * 6364136223846793005ULL);
175 #ifdef EIGEN_USE_SYCL
178 m_state += (
i * 6364136223846793005ULL);
183 for (
int j = 0;
j < packetSize; ++
j) {
186 return internal::pload<Packet>(
values);
191 #ifdef EIGEN_USE_SYCL
192 mutable bool m_exec_once;
196 template <
typename Scalar>
201 ((
sizeof(
Scalar) +
sizeof(
float) - 1) /
sizeof(
float)),
217 const T x = u -
T(0.449871);
219 q =
x*
x +
y * (
T(0.196)*
y -
T(0.25472)*
x);
220 }
while (
q >
T(0.27597) &&
228 return std::complex<float>(RandomToTypeNormal<float>(
state,
stream),
233 return std::complex<double>(RandomToTypeNormal<double>(
state,
stream),
244 m_state = PCG_XSH_RS_state(seed);
245 #ifdef EIGEN_USE_SYCL
262 #ifdef EIGEN_USE_SYCL
263 m_exec_once=
other.m_exec_once;
269 #ifdef EIGEN_USE_SYCL
272 m_state += (
i * 6364136223846793005ULL);
284 #ifdef EIGEN_USE_SYCL
287 m_state += (
i * 6364136223846793005ULL);
292 for (
int j = 0;
j < packetSize; ++
j) {
295 return internal::pload<Packet>(
values);
300 #ifdef EIGEN_USE_SYCL
301 mutable bool m_exec_once;
306 template <
typename Scalar>
322 #endif // EIGEN_CXX11_TENSOR_TENSOR_RANDOM_H