mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-11 11:19:02 +08:00
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:
parent
bcb29f890c
commit
7f8b53fd0e
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user