Skip to content
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

[BUG]: Visual Studio 2019 + CUDA <= 11.2 __builtin_is_constant_evaluated compilation error #1179

Closed
1 task done
ptheywood opened this issue Dec 6, 2023 · 1 comment · Fixed by #1180
Closed
1 task done
Labels
bug Something isn't working right.

Comments

@ptheywood
Copy link

Is this a duplicate?

Type of Bug

Compile-time Error

Component

libcu++

Describe the bug

Compialtion using Visual Studio 2019 (MSVC 19.29.30153.0, unsure if other versions are effected) encounters compilation errors using CUDA 11.1 and 11.2 (and 11.0, but that's not supported by CCCL).

D:\a\cccl-is-constant-evaluated-mwe\cccl-is-constant-evaluated-mwe\cccl\examples\example_project\build\_deps\cccl-src\libcudacxx\include\cuda\std\detail\libcxx\include\__type_traits/is_constant_evaluated.h(31): error : identifier "__builtin_is_constant_evaluated" is undefined [D:\a\cccl-is-constant-evaluated-mwe\cccl-is-constant-evaluated-mwe\cccl\examples\example_project\build\example_project.vcxproj]

This occurs within the examples/exmaple_project example in this repository.

How to Reproduce

  1. See the link below for a github-actions based reproducer
  2. Clone this repository
  3. Navigate to example/example_project
  4. cmake -B build -S .
  5. cmake --build build

Expected behavior

Successfull compilation of the example

Reproduction link

https://github.com/ptheywood/cccl-is-constant-evaluated-mwe-vs2019

Operating System

Windows with Visual Studio 2019

nvidia-smi output

No response

NVCC version

11.2.152
11.1.105
11.0.221 (but this is unsupported by CCCL)

@ptheywood ptheywood added the bug Something isn't working right. label Dec 6, 2023
miscco added a commit to miscco/cccl that referenced this issue Dec 6, 2023
@ptheywood found that there is an unfortunate incompatability of MSVC2019 which does support `__builtin_is_constant_evaluated` from 19.24 onwards and old nvcc below 11.3 which does not.

Fix this by hardening the condition we use to detect availability

Fixes NVIDIA#1179
@miscco
Copy link
Collaborator

miscco commented Dec 6, 2023

@ptheywood thanks a lot for bringing this up. This is indeed a bug that stems from the unfortunate need to manually select features on MSVC. I have opened a PR to fix this

jrhemstad pushed a commit that referenced this issue Dec 8, 2023
@ptheywood found that there is an unfortunate incompatability of MSVC2019 which does support `__builtin_is_constant_evaluated` from 19.24 onwards and old nvcc below 11.3 which does not.

Fix this by hardening the condition we use to detect availability

Fixes #1179
github-actions bot pushed a commit that referenced this issue Dec 8, 2023
@ptheywood found that there is an unfortunate incompatability of MSVC2019 which does support `__builtin_is_constant_evaluated` from 19.24 onwards and old nvcc below 11.3 which does not.

Fix this by hardening the condition we use to detect availability

Fixes #1179

(cherry picked from commit f8262e8)
miscco added a commit to miscco/cccl that referenced this issue Dec 8, 2023
@ptheywood found that there is an unfortunate incompatability of MSVC2019 which does support `__builtin_is_constant_evaluated` from 19.24 onwards and old nvcc below 11.3 which does not.

Fix this by hardening the condition we use to detect availability

Fixes NVIDIA#1179
jrhemstad pushed a commit that referenced this issue Dec 13, 2023
@ptheywood found that there is an unfortunate incompatability of MSVC2019 which does support `__builtin_is_constant_evaluated` from 19.24 onwards and old nvcc below 11.3 which does not.

Fix this by hardening the condition we use to detect availability

Fixes #1179
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working right.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants