From 6cd7355d94522aed0fa7f834499c49c38b481e3f Mon Sep 17 00:00:00 2001 From: Alexander Matthes Date: Fri, 27 Apr 2018 08:52:54 +0200 Subject: [PATCH] Changed precompiler test for cuda 9 workaround BOOST_WORKAROUND( BOOST_CUDA_VERSION, / 1000000 == 9 ) was not working because BOOST_CUDA_VERSION is defined as sum without brackets so / 1000000 was only applied to the last addend. --- include/boost/mp11/algorithm.hpp | 10 +++++----- include/boost/mp11/detail/mp_append.hpp | 2 +- include/boost/mp11/utility.hpp | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/boost/mp11/algorithm.hpp b/include/boost/mp11/algorithm.hpp index f5a88f6..4f24c4f 100644 --- a/include/boost/mp11/algorithm.hpp +++ b/include/boost/mp11/algorithm.hpp @@ -95,7 +95,7 @@ struct list_size_mismatch { }; -#if BOOST_WORKAROUND( BOOST_CUDA_VERSION, / 1000000 == 9 ) +#if BOOST_WORKAROUND( BOOST_CUDA_VERSION, >= 9000000 && BOOST_CUDA_VERSION < 10000000 ) template class F, class... L> struct mp_transform_cuda_workaround { @@ -112,7 +112,7 @@ template class F, class... L> using mp_transform = typename m #else -#if BOOST_WORKAROUND( BOOST_CUDA_VERSION, / 1000000 == 9 ) +#if BOOST_WORKAROUND( BOOST_CUDA_VERSION, >= 9000000 && BOOST_CUDA_VERSION < 10000000 ) template class F, class... L> using mp_transform = typename detail::mp_transform_cuda_workaround< F, L...>::type::type; @@ -320,7 +320,7 @@ template struct mp_at_c_impl #endif -#if BOOST_WORKAROUND( BOOST_CUDA_VERSION, / 1000000 == 9 ) +#if BOOST_WORKAROUND( BOOST_CUDA_VERSION, >= 9000000 && BOOST_CUDA_VERSION < 10000000 ) template struct mp_at_c_cuda_workaround { @@ -331,7 +331,7 @@ template struct mp_at_c_cuda_workaround } // namespace detail -#if BOOST_WORKAROUND( BOOST_CUDA_VERSION, / 1000000 == 9 ) +#if BOOST_WORKAROUND( BOOST_CUDA_VERSION, >= 9000000 && BOOST_CUDA_VERSION < 10000000 ) template using mp_at_c = typename detail::mp_at_c_cuda_workaround< L, I >::type::type; @@ -578,7 +578,7 @@ template class L, class T1, class... T, std::size_t I, templa using L2 = mp_second; - #if BOOST_WORKAROUND( BOOST_CUDA_VERSION, / 1000000 == 9 ) + #if BOOST_WORKAROUND( BOOST_CUDA_VERSION, >= 9000000 && BOOST_CUDA_VERSION < 10000000 ) struct detail { diff --git a/include/boost/mp11/detail/mp_append.hpp b/include/boost/mp11/detail/mp_append.hpp index bbcafad..1e48f01 100644 --- a/include/boost/mp11/detail/mp_append.hpp +++ b/include/boost/mp11/detail/mp_append.hpp @@ -133,7 +133,7 @@ template< using type = typename mp_append_impl::type; }; -#if BOOST_WORKAROUND( BOOST_CUDA_VERSION, / 1000000 == 9 ) +#if BOOST_WORKAROUND( BOOST_CUDA_VERSION, >= 9000000 && BOOST_CUDA_VERSION < 10000000 ) template struct mp_append_impl_cuda_workaround diff --git a/include/boost/mp11/utility.hpp b/include/boost/mp11/utility.hpp index 8c71711..eb4fe08 100644 --- a/include/boost/mp11/utility.hpp +++ b/include/boost/mp11/utility.hpp @@ -106,7 +106,7 @@ struct mp_no_type { }; -#if BOOST_WORKAROUND( BOOST_CUDA_VERSION, / 1000000 == 9 ) +#if BOOST_WORKAROUND( BOOST_CUDA_VERSION, >= 9000000 && BOOST_CUDA_VERSION < 10000000 ) template class F, class... T> struct mp_defer_cuda_workaround { @@ -117,7 +117,7 @@ template class F, class... T> struct mp_defer_cuda_workaround } // namespace detail -#if BOOST_WORKAROUND( BOOST_CUDA_VERSION, / 1000000 == 9 ) +#if BOOST_WORKAROUND( BOOST_CUDA_VERSION, >= 9000000 && BOOST_CUDA_VERSION < 10000000 ) template class F, class... T> using mp_defer = typename detail::mp_defer_cuda_workaround< F, T...>::type;