From 613971a370d2b25d1ceffd26271b8818cca3beff Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Thu, 12 Jul 2018 10:46:53 +0100 Subject: [PATCH] CUDA: Make function scope statics constexpr under CUDA. --- include/boost/math/tools/config.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/boost/math/tools/config.hpp b/include/boost/math/tools/config.hpp index 0a8363379..3ce6b7065 100644 --- a/include/boost/math/tools/config.hpp +++ b/include/boost/math/tools/config.hpp @@ -267,8 +267,10 @@ // // function scope static variables aren't allowed on CUDA device code: // -#ifdef __CUDA_ARCH__ +#if defined(__CUDA_ARCH__) && defined(BOOST_NO_CXX11_CONSTEXPR) #define BOOST_MATH_GPU_STATIC +#elif defined(__CUDA_ARCH__) +#define BOOST_MATH_GPU_STATIC constexpr #else #define BOOST_MATH_GPU_STATIC static #endif