mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Missing EIGEN_DEVICE_FUNCs to get gpu_basic passing with CUDA 9.
CUDA 9 seems to require labelling defaulted constructors as
`EIGEN_DEVICE_FUNC`, despite giving warnings that such labels are
ignored. Without these labels, the `gpu_basic` test fails to
compile, with errors about calling `__host__` functions from
`__host__ __device__` functions.
(cherry picked from commit 998bab4b04)
This commit is contained in:
committed by
Antonio Sánchez
parent
b8cf1ed753
commit
f03d3e7072
@@ -1225,7 +1225,7 @@ namespace Eigen {
|
||||
* This is necessary, because the implicit definition is deprecated if the copy-assignment is overridden.
|
||||
*/
|
||||
#if EIGEN_HAS_CXX11
|
||||
#define EIGEN_DEFAULT_COPY_CONSTRUCTOR(CLASS) CLASS(const CLASS&) = default;
|
||||
#define EIGEN_DEFAULT_COPY_CONSTRUCTOR(CLASS) EIGEN_DEVICE_FUNC CLASS(const CLASS&) = default;
|
||||
#else
|
||||
#define EIGEN_DEFAULT_COPY_CONSTRUCTOR(CLASS)
|
||||
#endif
|
||||
@@ -1250,12 +1250,12 @@ namespace Eigen {
|
||||
*/
|
||||
#if EIGEN_HAS_CXX11
|
||||
#define EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(Derived) \
|
||||
Derived() = default; \
|
||||
~Derived() = default;
|
||||
EIGEN_DEVICE_FUNC Derived() = default; \
|
||||
EIGEN_DEVICE_FUNC ~Derived() = default;
|
||||
#else
|
||||
#define EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(Derived) \
|
||||
Derived() {}; \
|
||||
/* ~Derived() {}; */
|
||||
EIGEN_DEVICE_FUNC Derived() {}; \
|
||||
/* EIGEN_DEVICE_FUNC ~Derived() {}; */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user