Files

62 lines
2.0 KiB
C++
Raw Permalink Normal View History

2010-03-15 17:55:47 +00:00
// (C) Copyright Eric Jourdanneau, Joel Falcou 2010
// Use, modification and distribution are subject to 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.
// NVIDIA CUDA C++ compiler setup
#ifndef BOOST_COMPILER
# define BOOST_COMPILER "NVIDIA CUDA C++ Compiler"
#endif
2017-08-11 19:38:00 +01:00
#if defined(__CUDACC_VER_MAJOR__) && defined(__CUDACC_VER_MINOR__) && defined(__CUDACC_VER_BUILD__)
2018-04-28 20:32:16 +03:00
# define BOOST_CUDA_VERSION (__CUDACC_VER_MAJOR__ * 1000000 + __CUDACC_VER_MINOR__ * 10000 + __CUDACC_VER_BUILD__)
2017-08-11 19:38:00 +01:00
#else
// We don't really know what the CUDA version is, but it's definitely before 7.5:
2017-08-18 18:13:38 +01:00
# define BOOST_CUDA_VERSION 7000000
2017-08-11 19:38:00 +01:00
#endif
2010-03-15 17:55:47 +00:00
// NVIDIA Specific support
// BOOST_GPU_ENABLED : Flag a function or a method as being enabled on the host and device
#define BOOST_GPU_ENABLED __host__ __device__
2016-01-12 16:40:54 +00:00
#if !defined(__clang__) || defined(__NVCC__)
2016-01-12 16:40:54 +00:00
// A bug in version 7.0 of CUDA prevents use of variadic templates in some occasions
// https://svn.boost.org/trac/boost/ticket/11897
// This is fixed in 7.5. As the following version macro was introduced in 7.5 an existance
// check is enough to detect versions < 7.5
2017-08-18 18:13:38 +01:00
#if BOOST_CUDA_VERSION < 7050000
2016-01-12 16:40:54 +00:00
# define BOOST_NO_CXX11_VARIADIC_TEMPLATES
#endif
2016-10-29 09:37:32 +01:00
// The same bug is back again in 8.0:
2017-08-18 18:13:38 +01:00
#if (BOOST_CUDA_VERSION > 8000000) && (BOOST_CUDA_VERSION < 8010000)
2016-10-29 09:37:32 +01:00
# define BOOST_NO_CXX11_VARIADIC_TEMPLATES
#endif
2018-07-09 17:54:42 +01:00
// CUDA (8.0) has no constexpr support in msvc mode:
#if defined(_MSC_VER) && (BOOST_CUDA_VERSION < 9000000)
2016-10-29 09:37:32 +01:00
# define BOOST_NO_CXX11_CONSTEXPR
#endif
#endif
#ifdef __CUDACC__
//
// When compiing .cu files, there's a bunch of stuff that doesn't work with msvc:
//
#if defined(_MSC_VER)
# define BOOST_NO_CXX14_DIGIT_SEPARATORS
# define BOOST_NO_CXX11_UNICODE_LITERALS
#endif
//
2017-06-15 17:54:41 +01:00
// And this one effects the NVCC front end,
// See https://svn.boost.org/trac/boost/ticket/13049
//
2017-08-18 18:13:38 +01:00
#if (BOOST_CUDA_VERSION >= 8000000) && (BOOST_CUDA_VERSION < 8010000)
# define BOOST_NO_CXX11_NOEXCEPT
#endif
#endif