Make numext::as_uint a device function.

This commit is contained in:
Rasmus Munk Larsen 2020-07-22 00:33:41 +00:00
parent 60faa9f897
commit 0aeaf5f451

View File

@ -681,10 +681,11 @@ bool not_equal_strict(const double& x,const double& y) { return std::not_equal_t
#endif #endif
/** \internal extract the bits of the float \a x */ /** \internal extract the bits of the float \a x */
inline unsigned int as_uint(float x) EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC unsigned int as_uint(float x)
{ {
unsigned int ret; unsigned int ret;
std::memcpy(&ret, &x, sizeof(float)); EIGEN_USING_STD(memcpy);
memcpy(&ret, &x, sizeof(float));
return ret; return ret;
} }