Simplify TensorRandom and remove time-dependence.

Time-dependence prevents tests from being repeatable. This has long been an issue with debugging the tensor tests (#1602 (closed)). Removing this will allow future tests to be repeatable in the usual way.

Also, the recently added macros in !476 (merged) are causing headaches across different platforms. For example, checking _XOPEN_SOURCE is leading to multiple ambiguous macro errors across Google, and _DEFAULT_SOURCE/_SVID_SOURCE/_BSD_SOURCE are sometimes defined with values, sometimes defined as empty, and sometimes not defined at all when they probably should be. This is leading to multiple build breakages.

The simplest approach is to generate a seed via Eigen::internal::random<uint64_t>() if on CPU. For GPU, we use a hash based on the current thread ID (since rand() isn't supported on GPU).

Fixes #1602 (closed).

Merge request reports

Loading