From 2b9297196c07c865febcaaad6bd3f0c92c636b9b Mon Sep 17 00:00:00 2001 From: Rasmus Munk Larsen Date: Tue, 16 Nov 2021 00:58:30 +0000 Subject: [PATCH] Update Transform.h to make `transform_construct_from_matrix` and `transform_take_affine_part` callable from device code. Fixes #2377. --- Eigen/src/Geometry/Transform.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Eigen/src/Geometry/Transform.h b/Eigen/src/Geometry/Transform.h index 39db9c75d..27ea9625e 100644 --- a/Eigen/src/Geometry/Transform.h +++ b/Eigen/src/Geometry/Transform.h @@ -1266,17 +1266,17 @@ template struct transform_take_affine_part { typedef typename TransformType::MatrixType MatrixType; typedef typename TransformType::AffinePart AffinePart; typedef typename TransformType::ConstAffinePart ConstAffinePart; - static inline AffinePart run(MatrixType& m) + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE AffinePart run(MatrixType& m) { return m.template block(0,0); } - static inline ConstAffinePart run(const MatrixType& m) + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ConstAffinePart run(const MatrixType& m) { return m.template block(0,0); } }; template struct transform_take_affine_part > { typedef typename Transform::MatrixType MatrixType; - static inline MatrixType& run(MatrixType& m) { return m; } - static inline const MatrixType& run(const MatrixType& m) { return m; } + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE MatrixType& run(MatrixType& m) { return m; } + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const MatrixType& run(const MatrixType& m) { return m; } }; /***************************************************** @@ -1286,7 +1286,7 @@ struct transform_take_affine_part > template struct transform_construct_from_matrix { - static inline void run(Transform *transform, const Other& other) + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(Transform *transform, const Other& other) { transform->linear() = other; transform->translation().setZero(); @@ -1297,7 +1297,7 @@ struct transform_construct_from_matrix template struct transform_construct_from_matrix { - static inline void run(Transform *transform, const Other& other) + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(Transform *transform, const Other& other) { transform->affine() = other; transform->makeAffine(); @@ -1307,14 +1307,14 @@ struct transform_construct_from_matrix template struct transform_construct_from_matrix { - static inline void run(Transform *transform, const Other& other) + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(Transform *transform, const Other& other) { transform->matrix() = other; } }; template struct transform_construct_from_matrix { - static inline void run(Transform *transform, const Other& other) + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(Transform *transform, const Other& other) { transform->matrix() = other.template block(0,0); } };