Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Commit 0218c49

Browse files
author
Olivier
committed
Splitting unary ops
1 parent 9abbba1 commit 0218c49

File tree

6 files changed

+871
-834
lines changed

6 files changed

+871
-834
lines changed

src/operator/mxnet_op.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ template<typename OP>
244244
struct Kernel<OP, cpu> {
245245
template<typename ...Args>
246246
inline static void Launch(mshadow::Stream<cpu> *s, const int N, Args... args) {
247+
#ifdef _OPENMP
247248
const int omp_cores = Engine::Get()->num_omp_threads_per_worker();
248249
if (omp_cores <= 1) {
249250
// Zero means not to use OMP, but don't interfere with external OMP behavior
@@ -257,6 +258,11 @@ struct Kernel<OP, cpu> {
257258
}
258259
}
259260
}
261+
#else
262+
for (int i = 0; i < N; ++i) {
263+
OP::Map(i, args...);
264+
}
265+
#endif
260266
};
261267

262268

0 commit comments

Comments
 (0)