aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHongxu Jia <hongxu.jia@windriver.com>2020-07-06 19:11:29 -0700
committerHongxu Jia <hongxu.jia@windriver.com>2020-07-07 10:15:51 +0800
commit17fe99fa101a51d62e55e0d4372b9301f1f5fbe3 (patch)
tree20cb420ae60cff04828c96dd818aa5cf737a4db7
parent973ea0e89cf0059a8efd0cfe3dad60d8a553a99f (diff)
downloadmeta-tensorflow-17fe99fa101a51d62e55e0d4372b9301f1f5fbe3.tar.gz
meta-tensorflow-17fe99fa101a51d62e55e0d4372b9301f1f5fbe3.tar.bz2
meta-tensorflow-17fe99fa101a51d62e55e0d4372b9301f1f5fbe3.zip
tensorflow: fix GCC 10.1 compile errorHEADmaster
Since python3-numpy: update 1.18.5 -> 1.19.0, there is a GCC 10.1 compile error. Backport a patch from upstream to fix it [1] [1] https://github.com/tensorflow/tensorflow/pull/40654 Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
-rw-r--r--recipes-framework/tensorflow/files/0001-Provide-overload-to-cope-with-const-ness-change-of-N.patch52
-rw-r--r--recipes-framework/tensorflow/tensorflow.inc1
2 files changed, 53 insertions, 0 deletions
diff --git a/recipes-framework/tensorflow/files/0001-Provide-overload-to-cope-with-const-ness-change-of-N.patch b/recipes-framework/tensorflow/files/0001-Provide-overload-to-cope-with-const-ness-change-of-N.patch
new file mode 100644
index 0000000..8d9411c
--- /dev/null
+++ b/recipes-framework/tensorflow/files/0001-Provide-overload-to-cope-with-const-ness-change-of-N.patch
@@ -0,0 +1,52 @@
+From 75ea0b31477d6ba9e990e296bbbd8ca4e7eebadf Mon Sep 17 00:00:00 2001
+From: Christian Sigg <csigg@google.com>
+Date: Fri, 26 Jun 2020 05:08:10 -0700
+Subject: [PATCH] Provide overload to cope with const-ness change of NumPy's
+ PyUFuncGenericFunction.
+
+See https://github.com/tensorflow/tensorflow/issues/40688, https://github.com/tensorflow/tensorflow/pull/40654.
+
+PiperOrigin-RevId: 318452381
+Change-Id: Icc5152f2b020ef19882a49e3c86ac80bbe048d64
+
+Upstream-Status: Backport
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+
+---
+ tensorflow/python/lib/core/bfloat16.cc | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/tensorflow/python/lib/core/bfloat16.cc b/tensorflow/python/lib/core/bfloat16.cc
+index feb01f11a1..bb6b720feb 100644
+--- a/tensorflow/python/lib/core/bfloat16.cc
++++ b/tensorflow/python/lib/core/bfloat16.cc
+@@ -517,7 +517,7 @@ bool RegisterBfloat16Cast(int numpy_type, bool cast_is_safe) {
+ }
+
+ template <typename InType, typename OutType, typename Functor>
+-void BinaryUFunc(char** args, npy_intp* dimensions, npy_intp* steps,
++void BinaryUFunc(char** args, const npy_intp* dimensions, const npy_intp* steps,
+ void* data) {
+ const char* i0 = args[0];
+ const char* i1 = args[1];
+@@ -532,11 +532,17 @@ void BinaryUFunc(char** args, npy_intp* dimensions, npy_intp* steps,
+ }
+ }
+
++// Numpy changed const-ness of PyUFuncGenericFunction, provide overload.
+ template <typename Functor>
+ void CompareUFunc(char** args, npy_intp* dimensions, npy_intp* steps,
+ void* data) {
+ BinaryUFunc<bfloat16, npy_bool, Functor>(args, dimensions, steps, data);
+ }
++template <typename Functor>
++void CompareUFunc(char** args, const npy_intp* dimensions,
++ const npy_intp* steps, void* data) {
++ BinaryUFunc<bfloat16, npy_bool, Functor>(args, dimensions, steps, data);
++}
+
+ struct Bfloat16EqFunctor {
+ npy_bool operator()(bfloat16 a, bfloat16 b) { return a == b; }
+--
+2.21.0
+
diff --git a/recipes-framework/tensorflow/tensorflow.inc b/recipes-framework/tensorflow/tensorflow.inc
index 4b06c5d..a729bdd 100644
--- a/recipes-framework/tensorflow/tensorflow.inc
+++ b/recipes-framework/tensorflow/tensorflow.inc
@@ -12,6 +12,7 @@ SRC_URI = "git://github.com/tensorflow/tensorflow.git;branch=r1.13 \
file://0001-Fix-TensorFlow-on-Python-3.8-logger-issue.patch \
file://0001-Rename-gettid-functions.patch \
file://0001-third_party-eigen_archive-workaround-ice-failure-whi.patch \
+ file://0001-Provide-overload-to-cope-with-const-ness-change-of-N.patch \
"
S = "${WORKDIR}/git"