BooleanRedux.h: Add more EIGEN_DEVICE_FUNC qualifiers.

This enables operator== on Eigen matrices in device code.


(cherry picked from commit 0aebe19aca58d78434cf724ef954a8383b2bf7c9)
This commit is contained in:
René Wagner 2020-04-23 17:25:08 +02:00 committed by Antonio Sánchez
parent 53a7864c48
commit 2f81b6363f

View File

@ -23,7 +23,7 @@ struct all_unroller
row = (UnrollCount-1) % Traits::RowsAtCompileTime row = (UnrollCount-1) % Traits::RowsAtCompileTime
}; };
static inline bool run(const Derived &mat) EIGEN_DEVICE_FUNC static inline bool run(const Derived &mat)
{ {
return all_unroller<Derived, UnrollCount-1>::run(mat) && mat.coeff(row, col); return all_unroller<Derived, UnrollCount-1>::run(mat) && mat.coeff(row, col);
} }
@ -32,13 +32,13 @@ struct all_unroller
template<typename Derived> template<typename Derived>
struct all_unroller<Derived, 0> struct all_unroller<Derived, 0>
{ {
static inline bool run(const Derived &/*mat*/) { return true; } EIGEN_DEVICE_FUNC static inline bool run(const Derived &/*mat*/) { return true; }
}; };
template<typename Derived> template<typename Derived>
struct all_unroller<Derived, Dynamic> struct all_unroller<Derived, Dynamic>
{ {
static inline bool run(const Derived &) { return false; } EIGEN_DEVICE_FUNC static inline bool run(const Derived &) { return false; }
}; };
template<typename Derived, int UnrollCount> template<typename Derived, int UnrollCount>
@ -50,7 +50,7 @@ struct any_unroller
row = (UnrollCount-1) % Traits::RowsAtCompileTime row = (UnrollCount-1) % Traits::RowsAtCompileTime
}; };
static inline bool run(const Derived &mat) EIGEN_DEVICE_FUNC static inline bool run(const Derived &mat)
{ {
return any_unroller<Derived, UnrollCount-1>::run(mat) || mat.coeff(row, col); return any_unroller<Derived, UnrollCount-1>::run(mat) || mat.coeff(row, col);
} }
@ -59,13 +59,13 @@ struct any_unroller
template<typename Derived> template<typename Derived>
struct any_unroller<Derived, 0> struct any_unroller<Derived, 0>
{ {
static inline bool run(const Derived & /*mat*/) { return false; } EIGEN_DEVICE_FUNC static inline bool run(const Derived & /*mat*/) { return false; }
}; };
template<typename Derived> template<typename Derived>
struct any_unroller<Derived, Dynamic> struct any_unroller<Derived, Dynamic>
{ {
static inline bool run(const Derived &) { return false; } EIGEN_DEVICE_FUNC static inline bool run(const Derived &) { return false; }
}; };
} // end namespace internal } // end namespace internal