[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
Thu May 16 17:40:10 PDT 2019


gtbercea marked an inline comment as done.
gtbercea added inline comments.


================
Comment at: lib/Headers/__clang_cuda_device_functions.h:1604
+#if defined(_OPENMP) && defined(__cplusplus)
+__DEVICE__ double log(long double __a) { return __nv_log((double)__a); }
+#endif
----------------
tra wrote:
> Should the return type also be `long double` ?
> In general long double is not supported by CUDA. I'd provide a declaration here, if it's absolutely needed, but no definition, so if someone  attempts to actually use it, the application will fail to link.
> 
> Silently reducing precision by falling back to double is the wrong thing to do, IMO.
Agreed.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62046/new/

https://reviews.llvm.org/D62046





More information about the cfe-commits mailing list