reminisce commented on a change in pull request #8566: optimize broadcast
URL: https://github.com/apache/incubator-mxnet/pull/8566#discussion_r149591356
 
 

 ##########
 File path: src/operator/mxnet_op.h
 ##########
 @@ -345,6 +394,13 @@ __global__ void mxnet_generic_kernel(int N, Args... args) 
{
   }
 }
 
+template<typename OP, typename ...Args>
+__global__ void mxnet_generic_kernel_ex(int N, Args... args) {
+  for (int i = blockIdx.x * blockDim.x + threadIdx.x; i < N; i += blockDim.x * 
gridDim.x) {
+    OP::Map(i, 1, args...);
 
 Review comment:
   For GPU, can we also get the number of threads first, and set the 
corresponding length here as you did for CPU? I think it will also accelerate 
computation on GPU side because of less calls to the functions `unravel` and 
`dot`, right?

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