You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/11/20 10:11:10 UTC

[GitHub] lebeg commented on a change in pull request #11148: [MXNET-679] Refactor handling BLAS libraries with cmake

lebeg commented on a change in pull request #11148: [MXNET-679] Refactor handling BLAS libraries with cmake
URL: https://github.com/apache/incubator-mxnet/pull/11148#discussion_r234940359
 
 

 ##########
 File path: tests/cpp/include/test_ndarray_utils.h
 ##########
 @@ -47,16 +49,13 @@ inline void CheckDataRegion(const TBlob &src, const TBlob &dst) {
   EXPECT_EQ(equals, 0);
 }
 
-inline unsigned gen_rand_seed() {
-  time_t timer;
-  ::time(&timer);
-  return static_cast<unsigned>(timer);
-}
-
 inline float RandFloat() {
-  static unsigned seed = gen_rand_seed();
-  double v = rand_r(&seed) * 1.0 / RAND_MAX;
-  return static_cast<float>(v);
+  static thread_local std::random_device device;
 
 Review comment:
   Yes, the change is big. But with a few exceptions all of the changes are closely related. It is extremely hard to satisfy all checks on the CI with CMake changes. Potentially I could take out the openblas source build and android related rand_s changes to a separate PR. Would that be an option?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services