summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToyohisa Kameyama <kameyama@riken.jp>2020-06-17 12:24:38 +0900
committerGitHub <noreply@github.com>2020-06-16 22:24:38 -0500
commit6e467d13a4992791ccab196b02873778f5f46a51 (patch)
tree75ae3c7e74b7aafe58ba6706091977ba6723cc13
parentb0c73c3325ac26fdc7aae4cd17e74260eee1087d (diff)
downloadspack-6e467d13a4992791ccab196b02873778f5f46a51.tar.gz
spack-6e467d13a4992791ccab196b02873778f5f46a51.tar.bz2
spack-6e467d13a4992791ccab196b02873778f5f46a51.tar.xz
spack-6e467d13a4992791ccab196b02873778f5f46a51.zip
mxnet: avoid GNU parallel shuffle without openmp. (#17095)
-rw-r--r--var/spack/repos/builtin/packages/mxnet/package.py1
-rw-r--r--var/spack/repos/builtin/packages/mxnet/parallell_shuffle.patch13
2 files changed, 14 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/mxnet/package.py b/var/spack/repos/builtin/packages/mxnet/package.py
index 2ff65265a7..8ef5035c07 100644
--- a/var/spack/repos/builtin/packages/mxnet/package.py
+++ b/var/spack/repos/builtin/packages/mxnet/package.py
@@ -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
diff --git a/var/spack/repos/builtin/packages/mxnet/parallell_shuffle.patch b/var/spack/repos/builtin/packages/mxnet/parallell_shuffle.patch
new file mode 100644
index 0000000000..eb286cde57
--- /dev/null
+++ b/var/spack/repos/builtin/packages/mxnet/parallell_shuffle.patch
@@ -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
+