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;
51 unsigned rnd = PCG_XSH_RS_generator(state, stream);
52 return static_cast<T>(rnd);
59 unsigned rnd = PCG_XSH_RS_generator(state,
stream);
60 const uint16_t half_bits =
static_cast<uint16_t>(rnd & 0x3ffu) | (static_cast<uint16_t>(15) << 10);
70 unsigned rnd = PCG_XSH_RS_generator(state,
stream);
71 const uint16_t half_bits =
static_cast<uint16_t>(rnd & 0x7fu) | (static_cast<uint16_t>(127) << 7);
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) {
184 values[
j] = RandomToTypeUniform<T>(&
m_state,
i);
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)),
216 v =
T(1.7156) * (RandomToTypeUniform<T>(
state,
stream) -
T(0.5));
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),
229 RandomToTypeNormal<float>(state,
stream));
233 return std::complex<double>(RandomToTypeNormal<double>(
state,
stream),
234 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) {
293 values[
j] = RandomToTypeNormal<T>(&
m_state,
i);
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
#define EIGEN_STRONG_INLINE
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE NormalRandomGenerator(const NormalRandomGenerator &other)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet packetOp(Index i) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T RandomToTypeNormal(uint64_t *state, uint64_t stream)
Namespace containing all symbols from the Eigen library.
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE internal::enable_if< NumTraits< T >::IsSigned||NumTraits< T >::IsComplex, typename NumTraits< T >::Real >::type abs(const T &x)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE double RandomToTypeUniform< double >(uint64_t *state, uint64_t stream)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE NormalRandomGenerator(uint64_t seed=0)
Array< int, Dynamic, 1 > v
unsigned __int64 uint64_t
Eigen::Triplet< double > T
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
EIGEN_DEVICE_FUNC const Scalar & q
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE float RandomToTypeUniform< float >(uint64_t *state, uint64_t stream)
#define EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Tgt bit_cast(const Src &src)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T RandomToTypeUniform(uint64_t *state, uint64_t stream)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T operator()(Index i) const
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T log(const T &x)
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
#define EIGEN_UNROLL_LOOP