XJDKC commented on a change in pull request #716:
URL: https://github.com/apache/singa/pull/716#discussion_r436273917



##########
File path: src/io/communicator.cc
##########
@@ -179,14 +175,14 @@ void Communicator::wait() {
   device_->Exec(
       [this](Context *ctx) mutable {
         // synchronizing on all the CUDA streams used by communicator
-        CUDA_CHECK(cudaEventRecord(event, s));
-        CUDA_CHECK(cudaStreamWaitEvent(NULL, event, 0));
-        CUDA_CHECK(cudaEventRecord(event, c1));
-        CUDA_CHECK(cudaStreamWaitEvent(NULL, event, 0));
-        CUDA_CHECK(cudaEventRecord(event, c2));
-        CUDA_CHECK(cudaStreamWaitEvent(NULL, event, 0));
+        CUDA_CHECK(cudaEventRecord(event, ctx->s));
+        CUDA_CHECK(cudaStreamWaitEvent(ctx->stream, event, 0));
+        CUDA_CHECK(cudaEventRecord(event, ctx->c1));
+        CUDA_CHECK(cudaStreamWaitEvent(ctx->stream, event, 0));
+        CUDA_CHECK(cudaEventRecord(event, ctx->c2));
+        CUDA_CHECK(cudaStreamWaitEvent(ctx->stream, event, 0));
       },
-      blocks_, blocks_, "wait");
+      blocks_, blocks_, "Sync");

Review comment:
       > I would like to rename all the waiting operators to be "waiting" so I 
can use a single condition in the if statement:
   > 
https://github.com/chrishkchris/singa/blob/SINGA-510_2/src/core/scheduler/scheduler.cc#L292
   > 
   > For the typo, I need to change it back to waiting instead of wait
   
   Got it.




----------------------------------------------------------------
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:
[email protected]


Reply via email to