mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-11 11:19:02 +08:00
Adds macro for checking if C++14 variable templates are supported
This commit is contained in:
parent
391094c507
commit
1720057023
@ -184,7 +184,7 @@ template<int N, int DynamicKey> struct cleanup_index_type<std::integral_constant
|
|||||||
|
|
||||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||||
|
|
||||||
#if EIGEN_HAS_CXX14
|
#if EIGEN_HAS_CXX14_VARIABLE_TEMPLATES
|
||||||
template<int N>
|
template<int N>
|
||||||
static const internal::FixedInt<N> fix{};
|
static const internal::FixedInt<N> fix{};
|
||||||
#else
|
#else
|
||||||
|
@ -162,8 +162,8 @@
|
|||||||
|
|
||||||
/// \internal EIGEN_COMP_IBM set to xlc version if the compiler is IBM XL C++
|
/// \internal EIGEN_COMP_IBM set to xlc version if the compiler is IBM XL C++
|
||||||
// XLC version
|
// XLC version
|
||||||
// 3.1 0x0301
|
// 3.1 0x0301
|
||||||
// 4.5 0x0405
|
// 4.5 0x0405
|
||||||
// 5.0 0x0500
|
// 5.0 0x0500
|
||||||
// 12.1 0x0C01
|
// 12.1 0x0C01
|
||||||
#if defined(__IBMCPP__) || defined(__xlc__) || defined(__ibmxl__)
|
#if defined(__IBMCPP__) || defined(__xlc__) || defined(__ibmxl__)
|
||||||
@ -637,6 +637,14 @@
|
|||||||
#define EIGEN_COMP_CXXVER 03
|
#define EIGEN_COMP_CXXVER 03
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef EIGEN_HAS_CXX14_VARIABLE_TEMPLATES
|
||||||
|
#if defined(__cpp_variable_templates) && __cpp_variable_templates >= 201304 && EIGEN_MAX_CPP_VER>=14
|
||||||
|
#define EIGEN_HAS_CXX14_VARIABLE_TEMPLATES 1
|
||||||
|
#else
|
||||||
|
#define EIGEN_HAS_CXX14_VARIABLE_TEMPLATES 0
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// The macros EIGEN_HAS_CXX?? defines a rough estimate of available c++ features
|
// The macros EIGEN_HAS_CXX?? defines a rough estimate of available c++ features
|
||||||
// but in practice we should not rely on them but rather on the availabilty of
|
// but in practice we should not rely on them but rather on the availabilty of
|
||||||
@ -833,7 +841,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// NOTE: the required Apple's clang version is very conservative
|
// NOTE: the required Apple's clang version is very conservative
|
||||||
// and it could be that XCode 9 works just fine.
|
// and it could be that XCode 9 works just fine.
|
||||||
// NOTE: the MSVC version is based on https://en.cppreference.com/w/cpp/compiler_support
|
// NOTE: the MSVC version is based on https://en.cppreference.com/w/cpp/compiler_support
|
||||||
// and not tested.
|
// and not tested.
|
||||||
@ -962,7 +970,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#define EIGEN_DEVICE_FUNC __attribute__((flatten)) __attribute__((always_inline))
|
#define EIGEN_DEVICE_FUNC __attribute__((flatten)) __attribute__((always_inline))
|
||||||
// All functions callable from CUDA/HIP code must be qualified with __device__
|
// All functions callable from CUDA/HIP code must be qualified with __device__
|
||||||
#elif defined(EIGEN_GPUCC)
|
#elif defined(EIGEN_GPUCC)
|
||||||
#define EIGEN_DEVICE_FUNC __host__ __device__
|
#define EIGEN_DEVICE_FUNC __host__ __device__
|
||||||
#else
|
#else
|
||||||
#define EIGEN_DEVICE_FUNC
|
#define EIGEN_DEVICE_FUNC
|
||||||
@ -989,7 +997,7 @@
|
|||||||
#else
|
#else
|
||||||
#define eigen_plain_assert(x)
|
#define eigen_plain_assert(x)
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
#if EIGEN_SAFE_TO_USE_STANDARD_ASSERT_MACRO
|
#if EIGEN_SAFE_TO_USE_STANDARD_ASSERT_MACRO
|
||||||
namespace Eigen {
|
namespace Eigen {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user