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

via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 6 04:01:16 PST 2023


blinkfrog wrote:

I would like to share some thoughts regarding the proposed fix involving the #ifdef _MSC_VER check in the LLVM PR for the fma function ambiguity issue. I am sorry if I say something stupid.

In the typical workflow with AdaptiveCpp and CUDA backend on Windows, MSVC is used only for compiling LLVM and Clang. However, the actual compilation of SYCL programs targeting the CUDA backend is performed using Clang with the AdaptiveCpp plugin.

Given this workflow, the #ifdef _MSC_VER check may not be effective because _MSC_VER is specific to the MSVC compiler and is not defined when using Clang, even on Windows. Consequently, this check might not activate during our compilation process, and the ambiguity issue with the `fma` function may persist.

A more suitable approach might be to use a different check that can effectively detect the Windows platform in the Clang environment, such as _WIN32, ensuring that the fix is applied in the relevant scenarios. Probably, better would be to check `_MSVC_STL_VERSION `, but this probably won't work, as standard libraries, where it is defined, are included after LLVM headers I think.

I wanted to bring this to your attention to ensure that the proposed solution addresses the issue in the context of workflows similar to ours.

Thank you for considering this point.

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


More information about the cfe-commits mailing list