From 0f350a8b7ead07d1828d0012c9ed9dc46d355b5c Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Thu, 21 Jul 2016 18:47:07 +0200 Subject: [PATCH] Fix CUDA compilation --- Eigen/src/Core/arch/CUDA/MathFunctions.h | 3 +++ unsupported/Eigen/CXX11/src/Tensor/TensorContractionCuda.h | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Eigen/src/Core/arch/CUDA/MathFunctions.h b/Eigen/src/Core/arch/CUDA/MathFunctions.h index 1f2eca061..5b5bf4c94 100644 --- a/Eigen/src/Core/arch/CUDA/MathFunctions.h +++ b/Eigen/src/Core/arch/CUDA/MathFunctions.h @@ -27,6 +27,7 @@ float4 plog(const float4& a) template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE double2 plog(const double2& a) { + using ::log; return make_double2(log(a.x), log(a.y)); } @@ -39,6 +40,7 @@ float4 pexp(const float4& a) template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE double2 pexp(const double2& a) { + using ::exp; return make_double2(exp(a.x), exp(a.y)); } @@ -51,6 +53,7 @@ float4 psqrt(const float4& a) template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE double2 psqrt(const double2& a) { + using ::sqrt; return make_double2(sqrt(a.x), sqrt(a.y)); } diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionCuda.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionCuda.h index 886474986..d65dbb40f 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionCuda.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionCuda.h @@ -461,8 +461,8 @@ EigenContractionKernelInternal(const LhsMapper lhs, const RhsMapper rhs, #undef writeResultShmem #undef writeRow - const int max_i_write = (min)((int)((m_size - base_m - threadIdx.y + 7) / 8), 8); - const int max_j_write = (min)((int)((n_size - base_n - threadIdx.z + 7) / 8), 8); + const int max_i_write = numext::mini((int)((m_size - base_m - threadIdx.y + 7) / 8), 8); + const int max_j_write = numext::mini((int)((n_size - base_n - threadIdx.z + 7) / 8), 8); if (threadIdx.x < max_i_write) { if (max_j_write == 8) {