diff --git a/include/boost/preprocessor/config/config.hpp b/include/boost/preprocessor/config/config.hpp index 2c1e72f..7abaaf0 100644 --- a/include/boost/preprocessor/config/config.hpp +++ b/include/boost/preprocessor/config/config.hpp @@ -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 diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index e12d73a..38ebc88 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -247,3 +247,13 @@ alias preprocessor_config : [ run config_info.cpp ] ; + +alias clang_cuda + : + [ compile clang_cuda.cu + : --cuda-gpu-arch=sm_20 + : clang_cuda_cu + ] + ; + +explicit clang_cuda ; diff --git a/test/clang_cuda.cu b/test/clang_cuda.cu new file mode 100644 index 0000000..e2fd6d1 --- /dev/null +++ b/test/clang_cuda.cu @@ -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 +# +# 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; +}