Skip to content

Trim constexpr from isA to improve Windows clang-cl support. #4119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ScottTodd
Copy link

See #1392, where this code was suggested (#1392 (comment)).

Full configure + build logs before/after this change: https://gist.github.com/ScottTodd/31083b69b4b6c5c58cf1579e3dbb3a49 . Generally speaking, constexpr support across compilers is fragile, particularly for more complex cases with composition of multiple functions, classes, etc.


I'm specifically using this clang-cl version, built from AMD's LLVM fork at https://github.com/ROCm/llvm-project by https://github.com/ROCm/TheRock:

λ D:\projects\TheRock\build\compiler\amd-llvm\dist\lib\llvm\bin\clang-cl.exe --version
AMD clang version 19.0.0git (https://github.com/ROCm/llvm-project.git 2012c1d23e398aa7fca45ba722fdd97c39f34491)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: D:\projects\TheRock\build\compiler\amd-llvm\dist\lib\llvm\bin

FWIW, when I try with an older version from MSVC, I get different errors:

λ clang-cl --version
clang version 18.1.8
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\Llvm\x64\bin
[1/4] Building CXX object CMakeFiles\fbgemm_generic.dir\src\spmmUtils.cc.obj
FAILED: CMakeFiles/fbgemm_generic.dir/src/spmmUtils.cc.obj 
C:\PROGRA~2\MICROS~2\2022\BUILDT~1\VC\Tools\Llvm\x64\bin\clang-cl.exe  /nologo -TP  -ID:\projects\FBGEMM\external\cpuinfo\include -ID:\projects\FBGEMM\external\asmjit\src -ID:\projects\FBGEMM\include -ID:\projects\FBGEMM /DWIN32 /D_WINDOWS /EHsc -Xclang -fopenmp /wd4244 /wd4267 /wd4305 /wd4309 /O2 /Ob2 /DNDEBUG -std:c++20 -MD /showIncludes /FoCMakeFiles\fbgemm_generic.dir\src\spmmUtils.cc.obj /FdCMakeFiles\fbgemm_generic.dir\ -c -- D:\projects\FBGEMM\src\spmmUtils.cc
In file included from D:\projects\FBGEMM\src\spmmUtils.cc:10:
In file included from D:\projects\FBGEMM\include\fbgemm/spmmUtils.h:10:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.42.34433\include\chrono:25:
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.42.34433\include\format(3205,54): error: capturing a structured binding is not yet supported in OpenMP
 3205 |         return _STD _Widen_and_copy<_CharT>(_Buffer, _End, _STD move(_Out));
      |                                                      ^
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.42.34433\include\format(3189,17): note: '_End' declared here
 3189 |     const auto [_End, _Ec] = _STD to_chars(_Buffer, _STD end(_Buffer), reinterpret_cast<uintptr_t>(_Value), 16);
      |                 ^

(full logs for that: https://gist.github.com/ScottTodd/fc346a1a9f7a6fe1b23f64fa49cb83ff)

Copy link

netlify bot commented May 13, 2025

Deploy Preview for pytorch-fbgemm-docs ready!

Name Link
🔨 Latest commit 7dd2556
🔍 Latest deploy log https://app.netlify.com/sites/pytorch-fbgemm-docs/deploys/68237543fcfa2d000706b0e4
😎 Deploy Preview https://deploy-preview-4119--pytorch-fbgemm-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@facebook-github-bot
Copy link
Contributor

Hi @ScottTodd!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants