yuxihu commented on a change in pull request #14615: Add PushAsyncPtr and 
PushSyncPtr APIs in engine
URL: https://github.com/apache/incubator-mxnet/pull/14615#discussion_r272351599
 
 

 ##########
 File path: src/engine/engine.cc
 ##########
 @@ -67,4 +67,26 @@ Engine* Engine::Get() {
   static Engine *inst = _GetSharedRef().get();
   return inst;
 }
+
+void Engine::PushAsyncPtr(AsyncFnPtr exec_fn_ptr, const std::shared_ptr<void>& 
param,
+                          Context exec_ctx, std::vector<VarHandle> const& 
const_vars,
+                          std::vector<VarHandle> const& mutable_vars,
+                          FnProperty prop, int priority,
+                          const char* opr_name, bool wait) {
+  auto exec_fn = [exec_fn_ptr, param](RunContext rctx,
 
 Review comment:
   I don't think we can do a ref capture here. This is where we want to do a 
copy of the shared_ptr which increases its ref count. When the exec_fn_ptr is 
called in another thread, we need to make sure param is still valid

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


With regards,
Apache Git Services

Reply via email to