mxnet: avoid GNU parallel shuffle without openmp. (#17095)

This commit is contained in:
Toyohisa Kameyama 2020-06-17 12:24:38 +09:00 committed by GitHub
parent b0c73c3325
commit 6e467d13a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View File

@ -46,6 +46,7 @@ class Mxnet(MakefilePackage):
patch('makefile.patch', when='@0.10:0.11')
patch('makefile.opencv.patch', when='@1.6.0')
patch('parallell_shuffle.patch', when='@1.6.0')
def build(self, spec, prefix):
# copy template configuration file

View File

@ -0,0 +1,13 @@
--- a/src/operator/random/shuffle_op.cc 2020-01-31 08:45:22.000000000 +0900
+++ b/src/operator/random/shuffle_op.cc 2020-06-15 11:34:32.000000000 +0900
@@ -22,8 +22,8 @@
* \file shuffle_op.cc
* \brief Operator to shuffle elements of an NDArray
*/
-#if !defined (__ANDROID__) && ((__GNUC__ > 4 &&\
- !defined(__clang__major__)) || (__clang_major__ > 4 && __linux__))
+#if ((__GNUC__ > 4 && !defined(__clang__major__)) || (__clang_major__ > 4 && __linux__)) && \
+ defined(_OPENMP) && !defined(__ANDROID__)
#define USE_GNU_PARALLEL_SHUFFLE
#endif