ptrendx commented on a change in pull request #20331:
URL: https://github.com/apache/incubator-mxnet/pull/20331#discussion_r701325238



##########
File path: src/engine/threaded_engine.cc
##########
@@ -523,5 +543,206 @@ void ThreadedEngine::OnCompleteStatic(Engine *engine, 
void *opr_block_,
   OprBlock::Delete(opr_block);
 }
 
+void ThreadedEngine::OnStartStatic(Engine *engine, void *opr_block,
+                                   const dmlc::Error* error) {
+  // no-op
+}
+
+#if MXNET_USE_CUDA
+static inline void AddEventHelper(
+  std::unordered_map<cudaStream_t, EventInfo>* events_per_stream,
+  const EventInfo& cuda_event) {
+  auto event_stream = cuda_event.stream;
+  if (events_per_stream->count(event_stream) > 0) {
+    if ((*events_per_stream)[event_stream].pool_index < cuda_event.pool_index) 
{
+      (*events_per_stream)[event_stream] = cuda_event;

Review comment:
       Because the pool is per stream so for 2 events from the same pool the 
one with the larger pool_index had to be recorded later (and synchronizing with 
that event will synchronize with both).




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to