Add fmod(half, half).

This is to support TensorFlow's `tf.math.floormod` for half.
This commit is contained in:
Antonio Sanchez
2021-03-15 13:00:32 -07:00
parent 14b7ebea11
commit f612df2736
2 changed files with 8 additions and 0 deletions

View File

@@ -729,6 +729,9 @@ EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC half ceil(const half& a) {
return half(::ceilf(float(a)));
#endif
}
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC half fmod(const half& a, const half& b) {
return half(::fmodf(float(a), float(b)));
}
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC half (min)(const half& a, const half& b) {
#if (defined(EIGEN_HAS_CUDA_FP16) && defined(EIGEN_CUDA_ARCH) && EIGEN_CUDA_ARCH >= 530) || \