Skip to content

Commit d04775e

Browse files
committed
Add remquo, frexp and modf overload functions to HIP header
1 parent 674f578 commit d04775e

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

clang/lib/Headers/__clang_hip_math.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,6 +1221,27 @@ __DEVICE__
12211221
inline _Float16 pow(_Float16 __base, int __iexp) {
12221222
return __ocml_pown_f16(__base, __iexp);
12231223
}
1224+
1225+
__DEVICE__
1226+
inline float remquo(float __x, float __y, int *__quo) {
1227+
return remquof(__x, __y, __quo);
1228+
}
1229+
1230+
template <typename __T1, typename __T2>
1231+
__DEVICE__
1232+
typename __hip_enable_if<std::numeric_limits<__T1>::is_specialized &&
1233+
std::numeric_limits<__T2>::is_specialized,
1234+
double>::type
1235+
remquo(__T1 __x, __T2 __y, int *__quo) {
1236+
return remquo((double)__x, (double)__y, __quo);
1237+
}
1238+
1239+
__DEVICE__
1240+
inline float frexp(float __x, int *__nptr) { return frexpf(__x, __nptr); }
1241+
1242+
__DEVICE__
1243+
inline float modf(float __x, float *__iptr) { return modff(__x, __iptr); }
1244+
12241245
#endif
12251246

12261247
#pragma pop_macro("__DEF_FUN1")

0 commit comments

Comments
 (0)