From: Ilya Biryukov Date: Thu, 22 Feb 2018 11:11:14 +0000 (-0800) Subject: Fix compile errors by patching eigen locally. X-Git-Tag: upstream/v1.7.0~31^2~466 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=37a5b16eb44e547d5122090ae1388e3ae60a2170;p=platform%2Fupstream%2Ftensorflow.git Fix compile errors by patching eigen locally. PiperOrigin-RevId: 186592198 --- diff --git a/tensorflow/workspace.bzl b/tensorflow/workspace.bzl index 0ca19b7..6eee41b 100644 --- a/tensorflow/workspace.bzl +++ b/tensorflow/workspace.bzl @@ -126,6 +126,7 @@ def tf_workspace(path_prefix="", tf_repo_name=""): sha256 = "0cadb31a35b514bf2dfd6b5d38205da94ef326ec6908fc3fd7c269948467214f", strip_prefix = "eigen-eigen-2355b229ea4c", build_file = str(Label("//third_party:eigen.BUILD")), + patch_file = str(Label("//third_party:eigen_fix_cuda_compilation.patch")) ) tf_http_archive( diff --git a/third_party/eigen_fix_cuda_compilation.patch b/third_party/eigen_fix_cuda_compilation.patch new file mode 100644 index 0000000..b921a7c --- /dev/null +++ b/third_party/eigen_fix_cuda_compilation.patch @@ -0,0 +1,38 @@ +diff --git a/Eigen/src/Core/ProductEvaluators.h b/Eigen/src/Core/ProductEvaluators.h +--- a/Eigen/src/Core/ProductEvaluators.h ++++ b/Eigen/src/Core/ProductEvaluators.h +@@ -137,7 +137,7 @@ struct Assignment::type> + { + typedef Product SrcXprType; +- static EIGEN_STRONG_INLINE ++ static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + void run(DstXprType &dst, const SrcXprType &src, const internal::assign_op &) + { + Index dstRows = src.rows(); +@@ -390,7 +390,7 @@ struct generic_product_impl::Scalar Scalar; + + template +- static EIGEN_STRONG_INLINE void evalTo(Dst& dst, const Lhs& lhs, const Rhs& rhs) ++ static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void evalTo(Dst& dst, const Lhs& lhs, const Rhs& rhs) + { + // Same as: dst.noalias() = lhs.lazyProduct(rhs); + // but easier on the compiler side +@@ -398,14 +398,14 @@ struct generic_product_impl +- static EIGEN_STRONG_INLINE void addTo(Dst& dst, const Lhs& lhs, const Rhs& rhs) ++ static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void addTo(Dst& dst, const Lhs& lhs, const Rhs& rhs) + { + // dst.noalias() += lhs.lazyProduct(rhs); + call_assignment_no_alias(dst, lhs.lazyProduct(rhs), internal::add_assign_op()); + } + + template +- static EIGEN_STRONG_INLINE void subTo(Dst& dst, const Lhs& lhs, const Rhs& rhs) ++ static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void subTo(Dst& dst, const Lhs& lhs, const Rhs& rhs) + { + // dst.noalias() -= lhs.lazyProduct(rhs); + call_assignment_no_alias(dst, lhs.lazyProduct(rhs), internal::sub_assign_op());