Fixes #2735: Component-wise cbrt

This commit is contained in:
Kyle Macfarlan
2023-10-25 03:06:13 +00:00
committed by Charles Schlosser
parent 48b254a4bc
commit 5de0f2f89e
14 changed files with 87 additions and 2 deletions

View File

@@ -1394,6 +1394,14 @@ bool sqrt<bool>(const bool &x) { return x; }
SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(sqrt, sqrt)
#endif
/** \returns the cube root of \a x. **/
template<typename T>
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
T cbrt(const T &x) {
EIGEN_USING_STD(cbrt);
return static_cast<T>(cbrt(x));
}
/** \returns the reciprocal square root of \a x. **/
template<typename T>
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE