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 2017/11/30 16:44:50 UTC

[GitHub] eric-haibin-lin commented on a change in pull request #8867: fix race when temp space is used in copy & fix instance overwrite in g2c

eric-haibin-lin commented on a change in pull request #8867: fix race when temp space is used in copy & fix instance overwrite in g2c
URL: https://github.com/apache/incubator-mxnet/pull/8867#discussion_r154131730
 
 

 ##########
 File path: src/ndarray/ndarray.cc
 ##########
 @@ -518,43 +515,57 @@ void CopyFromTo(const NDArray& from, const NDArray& to, int priority) {
   CHECK(from.shape().ndim() != 0)
       << "source operands have zero dimension shape";
   // important: callback must always capture by value
-  int a = from.ctx().dev_mask();
+  const auto from_ctx = from.ctx();
+  int a = from_ctx.dev_mask();
   int b = to.ctx().dev_mask();
   std::vector<Engine::VarHandle> const_vars;
   if (from.var() != to.var()) const_vars.push_back(from.var());
 
+  auto from_stype = from.storage_type();
+  auto to_stype = to.storage_type();
+
+  std::vector<Engine::VarHandle> mutable_vars(1, to.var());
+
+  std::vector<Resource> requested;
+  if (a == gpu::kDevMask && from_stype != to_stype) {
 
 Review comment:
   What if b is on GPU ?

----------------------------------------------------------------
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