[clang] d04775e - Add remquo, frexp and modf overload functions to HIP header
Yaxun Liu via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 29 17:58:29 PDT 2020
Author: Yaxun (Sam) Liu
Date: 2020-09-29T20:57:56-04:00
New Revision: d04775e16bba456f0be0aaa7478959c5bfa22c41
URL: https://github.com/llvm/llvm-project/commit/d04775e16bba456f0be0aaa7478959c5bfa22c41
DIFF: https://github.com/llvm/llvm-project/commit/d04775e16bba456f0be0aaa7478959c5bfa22c41.diff
LOG: Add remquo, frexp and modf overload functions to HIP header
Added:
Modified:
clang/lib/Headers/__clang_hip_math.h
Removed:
################################################################################
diff --git a/clang/lib/Headers/__clang_hip_math.h b/clang/lib/Headers/__clang_hip_math.h
index 0c27ef60a064..b72bb40ccdb6 100644
--- a/clang/lib/Headers/__clang_hip_math.h
+++ b/clang/lib/Headers/__clang_hip_math.h
@@ -1221,6 +1221,27 @@ __DEVICE__
inline _Float16 pow(_Float16 __base, int __iexp) {
return __ocml_pown_f16(__base, __iexp);
}
+
+__DEVICE__
+inline float remquo(float __x, float __y, int *__quo) {
+ return remquof(__x, __y, __quo);
+}
+
+template <typename __T1, typename __T2>
+__DEVICE__
+ typename __hip_enable_if<std::numeric_limits<__T1>::is_specialized &&
+ std::numeric_limits<__T2>::is_specialized,
+ double>::type
+ remquo(__T1 __x, __T2 __y, int *__quo) {
+ return remquo((double)__x, (double)__y, __quo);
+}
+
+__DEVICE__
+inline float frexp(float __x, int *__nptr) { return frexpf(__x, __nptr); }
+
+__DEVICE__
+inline float modf(float __x, float *__iptr) { return modff(__x, __iptr); }
+
#endif
#pragma pop_macro("__DEF_FUN1")
More information about the cfe-commits
mailing list