Skip to content

Commit

Permalink
Splitting unary ops
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivier committed Sep 25, 2017
1 parent 9abbba1 commit 0218c49
Show file tree
Hide file tree
Showing 6 changed files with 871 additions and 834 deletions.
6 changes: 6 additions & 0 deletions src/operator/mxnet_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ template<typename OP>
struct Kernel<OP, cpu> {
template<typename ...Args>
inline static void Launch(mshadow::Stream<cpu> *s, const int N, Args... args) {
#ifdef _OPENMP
const int omp_cores = Engine::Get()->num_omp_threads_per_worker();
if (omp_cores <= 1) {
// Zero means not to use OMP, but don't interfere with external OMP behavior
Expand All @@ -257,6 +258,11 @@ struct Kernel<OP, cpu> {
}
}
}
#else
for (int i = 0; i < N; ++i) {
OP::Map(i, args...);
}
#endif
};


Expand Down
Loading

0 comments on commit 0218c49

Please sign in to comment.