> ::inverse() const") from a __device__ function("ComputeHomography") is not allowed解决_cuda矩阵求逆的实现调用">
赞
踩
calling a __host__ function("Eigen::MatrixBase< ::Eigen::Matrix<float, (int)3, (int)3, (int)0, (int)3, (int)3> > ::inverse() const") from a __device__ function("ComputeHomography") is not allowed
Eigen3.3.9不行,换Eigen3.4。
https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.zip
修改Eigen3.3.9下的文件 …\eigen3\Eigen\src\LU\InverseImpl.h
第335行新加一句EIGEN_DEVICE_FUNC,使得inverse()函数同时在host和device函数中使用
template<typename Derived>
EIGEN_DEVICE_FUNC
inline const Inverse<Derived> MatrixBase<Derived>::inverse() const
{
EIGEN_STATIC_ASSERT(!NumTraits<Scalar>::IsInteger,THIS_FUNCTION_IS_NOT_FOR_INTEGER_NUMERIC_TYPES)
eigen_assert(rows() == cols());
return Inverse<Derived>(derived());
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。