This is an automated email from the ASF dual-hosted git repository.

jxie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/master by this push:
     new c74cf1b  enabling multithreading in broadcast_reduce (#9444)
c74cf1b is described below

commit c74cf1b3e3be8cfab7f92f646c9ac46ebe2ff6f8
Author: moin <[email protected]>
AuthorDate: Tue Jan 16 00:58:02 2018 +0100

    enabling multithreading in broadcast_reduce (#9444)
---
 src/operator/tensor/broadcast_reduce-inl.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/operator/tensor/broadcast_reduce-inl.h 
b/src/operator/tensor/broadcast_reduce-inl.h
index 1bfe68a..7f3e568 100644
--- a/src/operator/tensor/broadcast_reduce-inl.h
+++ b/src/operator/tensor/broadcast_reduce-inl.h
@@ -197,6 +197,7 @@ void seq_reduce_compute(const int N, const int M, const 
bool addto,
                         const DType *big, DType *small, const Shape<ndim> 
bshape,
                         const Shape<ndim> sshape, const Shape<ndim> rshape,
                         const Shape<ndim> rstride) {
+  #pragma omp parallel for 
num_threads(engine::OpenMP::Get()->GetRecommendedOMPThreadCount())
   for (int idx = 0; idx < N; ++idx) {
     seq_reduce_assign<Reducer, ndim, DType, OP>(idx, M, addto, big, small, 
bshape, sshape, rshape,
       rstride);
@@ -266,6 +267,7 @@ void seq_reduce_compute(const int N, const int M, const 
bool addto,
                         const Shape<ndim> lhs_shape, const Shape<ndim> 
lhs_stride,
                         const Shape<ndim> rhs_shape, const Shape<ndim> 
rhs_stride,
                         const Shape<ndim>& lhs_shape0, const Shape<ndim>& 
rhs_shape0) {
+  #pragma omp parallel for 
num_threads(engine::OpenMP::Get()->GetRecommendedOMPThreadCount())
   for (int idx = 0; idx < N; ++idx) {
     seq_reduce_assign<Reducer, ndim, DType, OP1, OP2>(idx, M, addto, big, lhs, 
rhs, small,
       big_shape, lhs_shape0, rhs_shape0, small_shape, rshape, lhs_shape, 
rhs_shape, rstride,

-- 
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].

Reply via email to