Adding EIGEN_DEVICE_FUNC in the Geometry module.

Additional CUDA necessary fixes in the Core (mostly usage of
EIGEN_USING_STD_MATH).
This commit is contained in:
Robert Lukierski
2016-10-12 16:35:17 +01:00
parent 7f0599b6eb
commit 86711497c4
21 changed files with 434 additions and 401 deletions

View File

@@ -641,11 +641,12 @@ MatrixBase<Derived>::triangularView() const
template<typename Derived>
bool MatrixBase<Derived>::isUpperTriangular(const RealScalar& prec) const
{
using std::abs;
EIGEN_USING_STD_MATH(abs)
RealScalar maxAbsOnUpperPart = static_cast<RealScalar>(-1);
EIGEN_USING_STD_MATH(min)
for(Index j = 0; j < cols(); ++j)
{
Index maxi = (std::min)(j, rows()-1);
Index maxi = min(j, rows()-1);
for(Index i = 0; i <= maxi; ++i)
{
RealScalar absValue = abs(coeff(i,j));
@@ -667,7 +668,8 @@ bool MatrixBase<Derived>::isUpperTriangular(const RealScalar& prec) const
template<typename Derived>
bool MatrixBase<Derived>::isLowerTriangular(const RealScalar& prec) const
{
using std::abs;
EIGEN_USING_STD_MATH(abs)
EIGEN_USING_STD_MATH(min)
RealScalar maxAbsOnLowerPart = static_cast<RealScalar>(-1);
for(Index j = 0; j < cols(); ++j)
for(Index i = j; i < rows(); ++i)
@@ -678,7 +680,7 @@ bool MatrixBase<Derived>::isLowerTriangular(const RealScalar& prec) const
RealScalar threshold = maxAbsOnLowerPart * prec;
for(Index j = 1; j < cols(); ++j)
{
Index maxi = (std::min)(j, rows()-1);
Index maxi = min(j, rows()-1);
for(Index i = 0; i < maxi; ++i)
if(abs(coeff(i, j)) > threshold) return false;
}
@@ -891,9 +893,10 @@ struct triangular_assignment_loop<Kernel, Mode, Dynamic, SetOpposite>
EIGEN_DEVICE_FUNC
static inline void run(Kernel &kernel)
{
EIGEN_USING_STD_MATH(min)
for(Index j = 0; j < kernel.cols(); ++j)
{
Index maxi = (std::min)(j, kernel.rows());
Index maxi = min(j, kernel.rows());
Index i = 0;
if (((Mode&Lower) && SetOpposite) || (Mode&Upper))
{