You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by zh...@apache.org on 2018/01/12 00:10:12 UTC

[incubator-mxnet] branch master updated: Remove using namespace mshadow from header file (bad practice) (#9321)

This is an automated email from the ASF dual-hosted git repository.

zhasheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/master by this push:
     new d511d98  Remove using namespace mshadow from header file (bad practice) (#9321)
d511d98 is described below

commit d511d98aeadf4392f8c4c1289d15feecdd98bf81
Author: Pedro Larroy <92...@users.noreply.github.com>
AuthorDate: Fri Jan 12 01:10:08 2018 +0100

    Remove using namespace mshadow from header file (bad practice) (#9321)
---
 mshadow                        | 2 +-
 src/common/random_generator.cu | 4 ++--
 src/common/random_generator.h  | 6 ++----
 3 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/mshadow b/mshadow
index 3d87ed2..16ac8cd 160000
--- a/mshadow
+++ b/mshadow
@@ -1 +1 @@
-Subproject commit 3d87ed2a4b47ef749c616f208cee45d920fb6e6e
+Subproject commit 16ac8cdfd1c5fbdbee781ec29aaa4478e6eb0ae0
diff --git a/src/common/random_generator.cu b/src/common/random_generator.cu
index edb3d4e..66969fe 100644
--- a/src/common/random_generator.cu
+++ b/src/common/random_generator.cu
@@ -45,13 +45,13 @@ __global__ void rand_generator_seed_kernel(curandStatePhilox4_32_10_t *states_,
 }
 
 template<>
-void RandGenerator<gpu, float>::Seed(Stream<gpu> *s, uint32_t seed) {
+void RandGenerator<gpu, float>::Seed(mshadow::Stream<gpu> *s, uint32_t seed) {
   using namespace mshadow::cuda;
   int ngrid = std::min(kMaxGridNum,
                        (RandGenerator<gpu, float>::kNumRandomStates + kBaseThreadNum - 1) /
                          kBaseThreadNum);
   rand_generator_seed_kernel
-      <<<ngrid, kBaseThreadNum, 0, Stream<gpu>::GetStream(s)>>>(
+      <<<ngrid, kBaseThreadNum, 0, mshadow::Stream<gpu>::GetStream(s)>>>(
           states_,
           RandGenerator<gpu, float>::kNumRandomStates,
           seed);
diff --git a/src/common/random_generator.h b/src/common/random_generator.h
index 01cbbd1..5d78b61 100644
--- a/src/common/random_generator.h
+++ b/src/common/random_generator.h
@@ -34,8 +34,6 @@
 #include "../common/cuda_utils.h"
 #endif  // MXNET_USE_CUDA
 
-using namespace mshadow;
-
 namespace mxnet {
 namespace common {
 namespace random {
@@ -90,7 +88,7 @@ class RandGenerator<cpu, DType> {
     delete[] inst->states_;
   }
 
-  MSHADOW_XINLINE void Seed(Stream<cpu> *, uint32_t seed) {
+  MSHADOW_XINLINE void Seed(mshadow::Stream<cpu> *, uint32_t seed) {
     for (int i = 0; i < kNumRandomStates; ++i) (states_ + i)->seed(seed + i);
   }
 
@@ -161,7 +159,7 @@ class RandGenerator<gpu, DType> {
     CUDA_CALL(cudaFree(inst->states_));
   }
 
-  void Seed(Stream<gpu> *s, uint32_t seed);
+  void Seed(mshadow::Stream<gpu> *s, uint32_t seed);
 
  private:
   curandStatePhilox4_32_10_t *states_;

-- 
To stop receiving notification emails like this one, please contact
['"commits@mxnet.apache.org" <co...@mxnet.apache.org>'].