tra added inline comments.

================
Comment at: lib/Headers/__clang_cuda_cmath.h:55-56
+#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
----------------
Where do these functions come from?  
https://en.cppreference.com/w/cpp/numeric/math/fabs does not seem to show any 
`abs` functions with const args.


================
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
----------------
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.


Repository:
  rC Clang

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

https://reviews.llvm.org/D62046



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to