aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Rasmus Larsen <rmlarsen@google.com>2019-05-24 16:05:31 +0000
committerGravatar Rasmus Larsen <rmlarsen@google.com>2019-05-24 16:05:31 +0000
commit36e0a2b93fd4cd4490afe1f271d617831074c809 (patch)
tree262bf3089f137ff65c1b838a081b99d529fab933
parentc5019f722bc76537ec56947e75fc4169deceffcd (diff)
parent2c389301610a0c60a5760fec7a362803a680ff60 (diff)
Merged in deven-amd/eigen-hip-fix-190524 (pull request PR-649)
fix for HIP build errors that were introduced by a commit earlier this week
-rw-r--r--Eigen/src/Core/arch/GPU/Half.h2
-rw-r--r--Eigen/src/Core/arch/GPU/PacketMathHalf.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/Eigen/src/Core/arch/GPU/Half.h b/Eigen/src/Core/arch/GPU/Half.h
index 7f1d7e5b8..5affe8b92 100644
--- a/Eigen/src/Core/arch/GPU/Half.h
+++ b/Eigen/src/Core/arch/GPU/Half.h
@@ -318,7 +318,7 @@ EIGEN_STRONG_INLINE __device__ bool operator >= (const half& a, const half& b) {
// We need to provide emulated *host-side* FP16 operators for clang.
#pragma push_macro("EIGEN_DEVICE_FUNC")
#undef EIGEN_DEVICE_FUNC
-#if defined(EIGEN_HAS_CUDA_FP16)
+#if defined(EIGEN_HAS_GPU_FP16)
#define EIGEN_DEVICE_FUNC __host__
#else // both host and device need emulated ops.
#define EIGEN_DEVICE_FUNC __host__ __device__
diff --git a/Eigen/src/Core/arch/GPU/PacketMathHalf.h b/Eigen/src/Core/arch/GPU/PacketMathHalf.h
index 3da8c1f3e..723506c8b 100644
--- a/Eigen/src/Core/arch/GPU/PacketMathHalf.h
+++ b/Eigen/src/Core/arch/GPU/PacketMathHalf.h
@@ -46,7 +46,7 @@ template<> struct packet_traits<Eigen::half> : default_packet_traits
template<> struct unpacket_traits<half2> { typedef Eigen::half type; enum {size=2, alignment=Aligned16, vectorizable=true, masked_load_available=false, masked_store_available=false}; typedef half2 half; };
template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE half2 pset1<half2>(const Eigen::half& from) {
-#if !defined(EIGEN_CUDA_ARCH)
+#if !defined(EIGEN_CUDA_ARCH) && !defined(EIGEN_HIP_DEVICE_COMPILE)
half2 r;
r.x = from;
r.y = from;