bug #1580: Fix cuda clang build. STL is not supported, so std::equal_to and std::not_equal breaks compilation.

Update the definition of EIGEN_CONSTEXPR_ARE_DEVICE_FUNC to exclude clang.
See also PR 450.
This commit is contained in:
Rasmus Munk Larsen 2018-08-01 12:36:24 -07:00
parent bcb29f890c
commit 7f8b53fd0e
2 changed files with 12 additions and 10 deletions

View File

@ -571,7 +571,6 @@
// Does the compiler fully support const expressions? (as in c++14)
#ifndef EIGEN_HAS_CONSTEXPR
#if defined(EIGEN_CUDACC)
// Const expressions are supported provided that c++11 is enabled and we're using either clang or nvcc 7.5 or above
#if EIGEN_MAX_CPP_VER>=14 && (__cplusplus > 199711L && (EIGEN_COMP_CLANG || EIGEN_CUDACC_VER >= 70500))
@ -643,9 +642,12 @@
#ifdef __CUDACC_RELAXED_CONSTEXPR__
#define EIGEN_CONSTEXPR_ARE_DEVICE_FUNC
#endif
#elif defined(__clang__) && defined(__CUDA__)
// clang++ always considers constexpr functions as implicitly __host__ __device__
#define EIGEN_CONSTEXPR_ARE_DEVICE_FUNC
// See bug 1580: clang/CUDA fails to make the following calls
// to constexpr bool std::equal_to::operator() even when
// EIGEN_CONSTEXPR_ARE_DEVICE_FUNC is defined in c++14 only.
// #elif defined(__clang__) && defined(__CUDA__) && EIGEN_HAS_CONSTEXPR == 1
// // clang++ always considers constexpr functions as implicitly __host__ __device__
// #define EIGEN_CONSTEXPR_ARE_DEVICE_FUNC
#endif
#endif