cjolivier01 commented on a change in pull request #9958: Parallelization for 
ROIpooling OP
URL: https://github.com/apache/incubator-mxnet/pull/9958#discussion_r171918889
 
 

 ##########
 File path: src/operator/roi_pooling.cc
 ##########
 @@ -74,7 +79,13 @@ inline void ROIPoolForward(const Tensor<cpu, 4, Dtype> &out,
 
     const Dtype* batch_data = bottom_data + data_size * roi_batch_ind;
 
+    #pragma omp parallel for firstprivate(batch_data, top_data, argmax_data)
     for (int c = 0; c < channels_; ++c) {
+      // Increment all data pointers
+      const Dtype* batch_data_c = batch_data + c * data_size_c;
+      Dtype* top_data_c = top_data + c * out_size_c;
+      Dtype* argmax_data_c = argmax_data + c * max_idx_size_c;
+
 
 Review comment:
   Sorry, I mean like this:
   ```cpp
   const Dtype *batch_data_c = batch_data;
   Dtype *top_data_c = top_data, *argmax_data_c = argmax_data;
   for (int c = 0; c < channels_; ++c, 
                                  batch_data_c  += data_size_c,
                                  top_data_c    += out_size_c,
                                  argmax_data_c += max_idx_size_c 
   ) {
   
   }
   ```

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to