From b730952414b19b988abae2a2ba2be86fb13cff88 Mon Sep 17 00:00:00 2001 From: Rasmus Munk Larsen Date: Tue, 1 Nov 2016 15:34:19 -0700 Subject: [PATCH] Don't attempts to use lgamma_r for CUDA devices. Fix type in lgamma_impl. --- .../Eigen/src/SpecialFunctions/SpecialFunctionsImpl.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/unsupported/Eigen/src/SpecialFunctions/SpecialFunctionsImpl.h b/unsupported/Eigen/src/SpecialFunctions/SpecialFunctionsImpl.h index 29d3ecb07..f3f2c78a3 100644 --- a/unsupported/Eigen/src/SpecialFunctions/SpecialFunctionsImpl.h +++ b/unsupported/Eigen/src/SpecialFunctions/SpecialFunctionsImpl.h @@ -121,7 +121,7 @@ template <> struct lgamma_impl { EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE float run(float x) { -#ifdef _BSD_SOURCE || _SVID_SOURCE +#if !defined(__CUDA_ARCH__) && (defined(_BSD_SOURCE) || defined(_SVID_SOURCE)) int signgam; return ::lgammaf_r(x, &signgam); #else @@ -134,9 +134,9 @@ template <> struct lgamma_impl { EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE double run(double x) { -#ifdef _BSD_SOURCE || _SVID_SOURCE +#if !defined(__CUDA_ARCH__) && (defined(_BSD_SOURCE) || defined(_SVID_SOURCE)) int signgam; - return ::lgammaf_r(x, &signgam); + return ::lgamma_r(x, &signgam); #else return ::lgamma(x); #endif