mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-13 12:19:12 +08:00
BooleanRedux.h: Add more EIGEN_DEVICE_FUNC qualifiers.
This enables operator== on Eigen matrices in device code.
This commit is contained in:
parent
3c02fefec5
commit
0aebe19aca
@ -22,7 +22,7 @@ struct all_unroller
|
|||||||
row = (UnrollCount-1) % Rows
|
row = (UnrollCount-1) % Rows
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline bool run(const Derived &mat)
|
EIGEN_DEVICE_FUNC static inline bool run(const Derived &mat)
|
||||||
{
|
{
|
||||||
return all_unroller<Derived, UnrollCount-1, Rows>::run(mat) && mat.coeff(row, col);
|
return all_unroller<Derived, UnrollCount-1, Rows>::run(mat) && mat.coeff(row, col);
|
||||||
}
|
}
|
||||||
@ -31,13 +31,13 @@ struct all_unroller
|
|||||||
template<typename Derived, int Rows>
|
template<typename Derived, int Rows>
|
||||||
struct all_unroller<Derived, 0, Rows>
|
struct all_unroller<Derived, 0, Rows>
|
||||||
{
|
{
|
||||||
static inline bool run(const Derived &/*mat*/) { return true; }
|
EIGEN_DEVICE_FUNC static inline bool run(const Derived &/*mat*/) { return true; }
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename Derived, int Rows>
|
template<typename Derived, int Rows>
|
||||||
struct all_unroller<Derived, Dynamic, Rows>
|
struct all_unroller<Derived, Dynamic, Rows>
|
||||||
{
|
{
|
||||||
static inline bool run(const Derived &) { return false; }
|
EIGEN_DEVICE_FUNC static inline bool run(const Derived &) { return false; }
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename Derived, int UnrollCount, int Rows>
|
template<typename Derived, int UnrollCount, int Rows>
|
||||||
@ -48,7 +48,7 @@ struct any_unroller
|
|||||||
row = (UnrollCount-1) % Rows
|
row = (UnrollCount-1) % Rows
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline bool run(const Derived &mat)
|
EIGEN_DEVICE_FUNC static inline bool run(const Derived &mat)
|
||||||
{
|
{
|
||||||
return any_unroller<Derived, UnrollCount-1, Rows>::run(mat) || mat.coeff(row, col);
|
return any_unroller<Derived, UnrollCount-1, Rows>::run(mat) || mat.coeff(row, col);
|
||||||
}
|
}
|
||||||
@ -57,13 +57,13 @@ struct any_unroller
|
|||||||
template<typename Derived, int Rows>
|
template<typename Derived, int Rows>
|
||||||
struct any_unroller<Derived, 0, Rows>
|
struct any_unroller<Derived, 0, Rows>
|
||||||
{
|
{
|
||||||
static inline bool run(const Derived & /*mat*/) { return false; }
|
EIGEN_DEVICE_FUNC static inline bool run(const Derived & /*mat*/) { return false; }
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename Derived, int Rows>
|
template<typename Derived, int Rows>
|
||||||
struct any_unroller<Derived, Dynamic, Rows>
|
struct any_unroller<Derived, Dynamic, Rows>
|
||||||
{
|
{
|
||||||
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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user