[clang] [CUDA][Win32] Add `fma(long double,..)` to math forward declares. (PR #73756)

Artem Belevich via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 6 13:46:07 PST 2023


================
@@ -70,6 +70,9 @@ __DEVICE__ double floor(double);
 __DEVICE__ float floor(float);
 __DEVICE__ double fma(double, double, double);
 __DEVICE__ float fma(float, float, float);
+#ifdef _MSC_VER
+__DEVICE__ long double fma(long double, long double, long double);
----------------
Artem-B wrote:

Correct. If someone ends up using fma(long double) in the GPU-side code, we will fail at build time, until the implementation is actually available. Failure in ptxas is not the best way to diagnose it, but it's better than failing to compile valid code because of a CUDA compatibility quirk in a standard library.

https://github.com/llvm/llvm-project/pull/73756


More information about the cfe-commits mailing list