Adjusted the configuration so that compiling a cuda source file ( .cu ) using clang does not set BOOST_PP_VARIADICS to 0. An 'explicit' test was also added for this situation.

This commit is contained in:
Edward Diener
2019-09-14 10:27:14 -04:00
parent 5756fb08ad
commit c436de6142
3 changed files with 40 additions and 1 deletions

View File

@ -80,7 +80,7 @@
# if !defined BOOST_PP_VARIADICS
# /* variadic support explicitly disabled for all untested compilers */
# if defined __GCCXML__ || defined __CUDACC__ || defined __PATHSCALE__ || defined __DMC__ || defined __CODEGEARC__ || defined __BORLANDC__ || defined __MWERKS__ || ( defined __SUNPRO_CC && __SUNPRO_CC < 0x5120 ) || defined __HP_aCC && !defined __EDG__ || defined __MRC__ || defined __SC__ || (defined(__PGI) && !defined(__EDG__))
# if defined __GCCXML__ || (defined __CUDACC__ && !(defined(__clang__) && defined(__CUDA__))) || defined __PATHSCALE__ || defined __DMC__ || defined __CODEGEARC__ || defined __BORLANDC__ || defined __MWERKS__ || ( defined __SUNPRO_CC && __SUNPRO_CC < 0x5120 ) || (defined __HP_aCC && !defined __EDG__) || defined __MRC__ || defined __SC__ || (defined(__PGI) && !defined(__EDG__))
# define BOOST_PP_VARIADICS 0
# elif defined(_MSC_VER) && defined(__clang__)
# define BOOST_PP_VARIADICS 1

View File

@ -247,3 +247,13 @@ alias preprocessor_config
:
[ run config_info.cpp ]
;
alias clang_cuda
:
[ compile clang_cuda.cu
: <cxxflags>--cuda-gpu-arch=sm_20
: clang_cuda_cu
]
;
explicit clang_cuda ;

29
test/clang_cuda.cu Normal file
View File

@ -0,0 +1,29 @@
# /* **************************************************************************
# * *
# * (C) Copyright Edward Diener 2019.
# * Distributed under the Boost Software License, Version 1.0. (See
# * accompanying file LICENSE_1_0.txt or copy at
# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* See http://www.boost.org for most recent version. */
#
# include <boost/preprocessor/cat.hpp>
#
# define BEGIN typedef int BOOST_PP_CAT(test_, __LINE__)[((
# define END )==1) ? 1 : -1];
#if defined(__clang__) && defined(__CUDACC__) && defined(__CUDA__)
BEGIN BOOST_PP_VARIADICS == 1 END
#else
BEGIN 0 == 1 END
#endif
int main(void) {
return 0;
}