aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src
diff options
context:
space:
mode:
authorGravatar Antonio Sanchez <cantonios@google.com>2021-03-15 13:00:32 -0700
committerGravatar Antonio Sanchez <cantonios@google.com>2021-03-15 13:32:24 -0700
commitf612df273689a19d25b45ca4f8269463207c4fee (patch)
treee2ac42271047c9718e807e56987727741ebf22b6 /Eigen/src
parent14b7ebea11808b2e44995e4a5cd668f1da4071c0 (diff)
Add fmod(half, half).
This is to support TensorFlow's `tf.math.floormod` for half.
Diffstat (limited to 'Eigen/src')
-rw-r--r--Eigen/src/Core/arch/Default/Half.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/Eigen/src/Core/arch/Default/Half.h b/Eigen/src/Core/arch/Default/Half.h
index 6529f14ec..56ff7cec3 100644
--- a/Eigen/src/Core/arch/Default/Half.h
+++ b/Eigen/src/Core/arch/Default/Half.h
@@ -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) || \