[PATCH] D62046: [OpenMP][bugfix] Add missing math functions variants for log and abs.
Gheorghe-Teodor Bercea via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri May 17 08:19:20 PDT 2019
gtbercea updated this revision to Diff 200048.
gtbercea added a comment.
- update patch
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D62046/new/
https://reviews.llvm.org/D62046
Files:
lib/Headers/__clang_cuda_cmath.h
lib/Headers/__clang_cuda_math_forward_declares.h
Index: lib/Headers/__clang_cuda_math_forward_declares.h
===================================================================
--- lib/Headers/__clang_cuda_math_forward_declares.h
+++ lib/Headers/__clang_cuda_math_forward_declares.h
@@ -42,6 +42,10 @@
__DEVICE__ double abs(double);
__DEVICE__ float abs(float);
#endif
+#if defined(_OPENMP) && defined(__cplusplus)
+__DEVICE__ const double abs(const double);
+__DEVICE__ const float abs(const float);
+#endif
__DEVICE__ int abs(int) __NOEXCEPT;
__DEVICE__ double acos(double);
__DEVICE__ float acos(float);
@@ -144,6 +148,9 @@
__DEVICE__ float log2(float);
__DEVICE__ double logb(double);
__DEVICE__ float logb(float);
+#if defined(_OPENMP) && defined(__cplusplus)
+__DEVICE__ long double log(long double);
+#endif
__DEVICE__ double log(double);
__DEVICE__ float log(float);
__DEVICE__ long lrint(double);
Index: lib/Headers/__clang_cuda_cmath.h
===================================================================
--- lib/Headers/__clang_cuda_cmath.h
+++ lib/Headers/__clang_cuda_cmath.h
@@ -51,6 +51,10 @@
__DEVICE__ float abs(float __x) { return ::fabsf(__x); }
__DEVICE__ double abs(double __x) { return ::fabs(__x); }
#endif
+#if defined(_OPENMP) && defined(__cplusplus)
+__DEVICE__ const float abs(const float __x) { return ::fabsf((float)__x); }
+__DEVICE__ const double abs(const double __x) { return ::fabs((double)__x); }
+#endif
__DEVICE__ float acos(float __x) { return ::acosf(__x); }
__DEVICE__ float asin(float __x) { return ::asinf(__x); }
__DEVICE__ float atan(float __x) { return ::atanf(__x); }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62046.200048.patch
Type: text/x-patch
Size: 1578 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190517/88918683/attachment.bin>
More information about the cfe-commits
mailing list