Skip to content

Remove constexpr for NVCC on Windows#40675

Closed
peterjc123 wants to merge 1 commit intopytorch:masterfrom
peterjc123:constexpr_nvcc_windows
Closed

Remove constexpr for NVCC on Windows#40675
peterjc123 wants to merge 1 commit intopytorch:masterfrom
peterjc123:constexpr_nvcc_windows

Conversation

@peterjc123
Copy link
Copy Markdown
Collaborator

They are not well supported. Fixes #40393 and #39394.

@peterjc123 peterjc123 requested review from ezyang and malfet June 28, 2020 05:59
@peterjc123 peterjc123 requested a review from apaszke as a code owner June 28, 2020 05:59
@facebook-github-bot facebook-github-bot added the oncall: jit Add this issue/PR to JIT oncall triage queue label Jun 28, 2020
Copy link
Copy Markdown
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ezyang is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@ezyang merged this pull request in d2e16dd.

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@ezyang merged this pull request in d2e16dd.

1 similar comment
@facebook-github-bot
Copy link
Copy Markdown
Contributor

@ezyang merged this pull request in d2e16dd.

@peterjc123 peterjc123 deleted the constexpr_nvcc_windows branch July 1, 2020 03:35
@pbelevich
Copy link
Copy Markdown
Contributor

nvcc + module.h + CONSTEXPR_EXCEPT_WIN_CUDA:

[1/1] C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin\nvcc -Xcompiler /MD -Xcompiler /wd4819 -Xcompiler /wd4251 -Xcompiler /wd4244 -Xcompiler /wd4267 -Xcompiler /wd4275 -Xcompiler /wd4018 -Xcompiler /wd4190 -Xcompiler /EHsc -Xcudafe --diag_suppress=base_class_has_different_dll_interface -Xcudafe --diag_suppress=field_without_dll_interface -Xcudafe --diag_suppress=dll_interface_conflict_none_assumed -Xcudafe --diag_suppress=dll_interface_conflict_dllexport_assumed -IC:\tools\miniconda3\envs\env3.6\lib\site-packages\torch\include -IC:\tools\miniconda3\envs\env3.6\lib\site-packages\torch\include\torch\csrc\api\include -IC:\tools\miniconda3\envs\env3.6\lib\site-packages\torch\include\TH -IC:\tools\miniconda3\envs\env3.6\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" -IC:\tools\miniconda3\envs\env3.6\include -IC:\tools\miniconda3\envs\env3.6\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" -c C:\Users\circleci\project\torch_csprng\csrc\csprng.cu -o C:\Users\circleci\project\build\temp.win-amd64-3.6\Release\Users\circleci\project\torch_csprng\csrc\csprng.obj -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=sm_70 -gencode=arch=compute_75,code=sm_75 -gencode=arch=compute_50,code=compute_50 --expt-extended-lambda -Xcompiler -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=torch_csprng -D_GLIBCXX_USE_CXX11_ABI=0
FAILED: C:/Users/circleci/project/build/temp.win-amd64-3.6/Release/Users/circleci/project/torch_csprng/csrc/csprng.obj 
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin\nvcc -Xcompiler /MD -Xcompiler /wd4819 -Xcompiler /wd4251 -Xcompiler /wd4244 -Xcompiler /wd4267 -Xcompiler /wd4275 -Xcompiler /wd4018 -Xcompiler /wd4190 -Xcompiler /EHsc -Xcudafe --diag_suppress=base_class_has_different_dll_interface -Xcudafe --diag_suppress=field_without_dll_interface -Xcudafe --diag_suppress=dll_interface_conflict_none_assumed -Xcudafe --diag_suppress=dll_interface_conflict_dllexport_assumed -IC:\tools\miniconda3\envs\env3.6\lib\site-packages\torch\include -IC:\tools\miniconda3\envs\env3.6\lib\site-packages\torch\include\torch\csrc\api\include -IC:\tools\miniconda3\envs\env3.6\lib\site-packages\torch\include\TH -IC:\tools\miniconda3\envs\env3.6\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" -IC:\tools\miniconda3\envs\env3.6\include -IC:\tools\miniconda3\envs\env3.6\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" -c C:\Users\circleci\project\torch_csprng\csrc\csprng.cu -o C:\Users\circleci\project\build\temp.win-amd64-3.6\Release\Users\circleci\project\torch_csprng\csrc\csprng.obj -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=sm_70 -gencode=arch=compute_75,code=sm_75 -gencode=arch=compute_50,code=compute_50 --expt-extended-lambda -Xcompiler -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=torch_csprng -D_GLIBCXX_USE_CXX11_ABI=0
cl : Command line warning D9002 : ignoring unknown option '-fopenmp'
csprng.cu
C:/tools/miniconda3/envs/env3.6/lib/site-packages/torch/include\c10/util/ThreadLocalDebugInfo.h(12): warning: modifier is ignored on an enum specifier

C:/tools/miniconda3/envs/env3.6/lib/site-packages/torch/include\ATen/record_function.h(18): warning: modifier is ignored on an enum specifier

C:/tools/miniconda3/envs/env3.6/lib/site-packages/torch/include\torch/csrc/jit/api/module.h(483): error: a member with an in-class initializer must be const

C:/tools/miniconda3/envs/env3.6/lib/site-packages/torch/include\torch/csrc/jit/api/module.h(496): error: a member with an in-class initializer must be const

C:/tools/miniconda3/envs/env3.6/lib/site-packages/torch/include\torch/csrc/jit/api/module.h(510): error: a member with an in-class initializer must be const

C:/tools/miniconda3/envs/env3.6/lib/site-packages/torch/include\torch/csrc/jit/api/module.h(523): error: a member with an in-class initializer must be const

bdhirsh added a commit that referenced this pull request Jun 17, 2021
Relanding this PR, but with a fix for windows cuda builds (example failure in master here: https://github.com/pytorch/pytorch/runs/2852662871)

This is identical to the original PR except for one change in `tools/codegen/gen.py`: `static constexpr` -> `static CONSTEXPR_EXCEPT_WIN_CUDA`

This actually took a while to figure out, until I tracked down a previous pytorch PR that encountered a similar issue: #40675

This reverts commit 6d0fb85.



Differential Revision: [D29213932](https://our.internmc.facebook.com/intern/diff/D29213932)

[ghstack-poisoned]
bdhirsh added a commit that referenced this pull request Jun 18, 2021
Relanding this PR, but with a fix for windows cuda builds (example failure in master here: https://github.com/pytorch/pytorch/runs/2852662871)

This is identical to the original PR except for one change in `tools/codegen/gen.py`: `static constexpr` -> `static CONSTEXPR_CONST_EXCEPT_WIN_CUDA` (had to make a new macro that was a slight adjustment to an existing one)

This actually took a while to figure out, until I tracked down a previous pytorch PR that encountered a similar issue: #40675

This reverts commit 6d0fb85.



Differential Revision: [D29213932](https://our.internmc.facebook.com/intern/diff/D29213932)

[ghstack-poisoned]
bdhirsh added a commit that referenced this pull request Jun 21, 2021
Relanding this PR, but with a fix for windows cuda builds (example failure in master here: https://github.com/pytorch/pytorch/runs/2852662871)

This is identical to the original PR except for one change in `tools/codegen/gen.py`: `static constexpr` -> `static CONSTEXPR_CONST_EXCEPT_WIN_CUDA` (had to make a new macro that was a slight adjustment to an existing one)

This actually took a while to figure out, until I tracked down a previous pytorch PR that encountered a similar issue: #40675

This reverts commit 6d0fb85.



Differential Revision: [D29213932](https://our.internmc.facebook.com/intern/diff/D29213932)

[ghstack-poisoned]
bdhirsh added a commit that referenced this pull request Jun 21, 2021
Relanding this PR, but with a fix for windows cuda builds (example failure in master here: https://github.com/pytorch/pytorch/runs/2852662871)

This is identical to the original PR except for one change in `tools/codegen/gen.py`: `static constexpr` -> `static CONSTEXPR_CONST_EXCEPT_WIN_CUDA` (had to make a new macro that was a slight adjustment to an existing one)

This actually took a while to figure out, until I tracked down a previous pytorch PR that encountered a similar issue: #40675

This reverts commit 6d0fb85.



Differential Revision: [D29213932](https://our.internmc.facebook.com/intern/diff/D29213932)

[ghstack-poisoned]
bdhirsh added a commit that referenced this pull request Jun 22, 2021
Relanding this PR, but with a fix for windows cuda builds (example failure in master here: https://github.com/pytorch/pytorch/runs/2852662871)

This is identical to the original PR except for one change in `tools/codegen/gen.py`: `static constexpr` -> `static CONSTEXPR_CONST_EXCEPT_WIN_CUDA` (had to make a new macro that was a slight adjustment to an existing one)

This actually took a while to figure out, until I tracked down a previous pytorch PR that encountered a similar issue: #40675

This reverts commit 6d0fb85.



Differential Revision: [D29213932](https://our.internmc.facebook.com/intern/diff/D29213932)

[ghstack-poisoned]
bdhirsh added a commit that referenced this pull request Jun 22, 2021
Relanding this PR, but with a fix for windows cuda builds (example failure in master here: https://github.com/pytorch/pytorch/runs/2852662871)

This is identical to the original PR except for one change in `tools/codegen/gen.py`: `static constexpr` -> `static CONSTEXPR_CONST_EXCEPT_WIN_CUDA` (had to make a new macro that was a slight adjustment to an existing one)

This actually took a while to figure out, until I tracked down a previous pytorch PR that encountered a similar issue: #40675

This reverts commit 6d0fb85.



Differential Revision: [D29213932](https://our.internmc.facebook.com/intern/diff/D29213932)

[ghstack-poisoned]
bdhirsh added a commit that referenced this pull request Jun 22, 2021
Relanding this PR, but with a fix for windows cuda builds (example failure in master here: https://github.com/pytorch/pytorch/runs/2852662871)

This is identical to the original PR except for one change in `tools/codegen/gen.py`: `static constexpr` -> `static CONSTEXPR_CONST_EXCEPT_WIN_CUDA` (had to make a new macro that was a slight adjustment to an existing one)

This actually took a while to figure out, until I tracked down a previous pytorch PR that encountered a similar issue: #40675

This reverts commit 6d0fb85.



Differential Revision: [D29213932](https://our.internmc.facebook.com/intern/diff/D29213932)

[ghstack-poisoned]
bdhirsh added a commit that referenced this pull request Jun 22, 2021
Relanding this PR, but with a fix for windows cuda builds (example failure in master here: https://github.com/pytorch/pytorch/runs/2852662871)

This is identical to the original PR except for one change in `tools/codegen/gen.py`: `static constexpr` -> `static CONSTEXPR_CONST_EXCEPT_WIN_CUDA` (had to make a new macro that was a slight adjustment to an existing one)

This actually took a while to figure out, until I tracked down a previous pytorch PR that encountered a similar issue: #40675

This reverts commit 6d0fb85.



Differential Revision: [D29213932](https://our.internmc.facebook.com/intern/diff/D29213932)

[ghstack-poisoned]
bdhirsh added a commit that referenced this pull request Jun 22, 2021
Relanding this PR, but with a fix for windows cuda builds (example failure in master here: https://github.com/pytorch/pytorch/runs/2852662871)

This is identical to the original PR except for one change in `tools/codegen/gen.py`: `static constexpr` -> `static CONSTEXPR_CONST_EXCEPT_WIN_CUDA` (had to make a new macro that was a slight adjustment to an existing one)

This actually took a while to figure out, until I tracked down a previous pytorch PR that encountered a similar issue: #40675

This reverts commit 6d0fb85.



Differential Revision: [D29213932](https://our.internmc.facebook.com/intern/diff/D29213932)

[ghstack-poisoned]
bdhirsh added a commit that referenced this pull request Jun 22, 2021
Reland of #59115, but with a fix for windows cuda builds (example failure in master here: https://github.com/pytorch/pytorch/runs/2852662871)

This is identical to the original PR except for one change in `tools/codegen/gen.py`: `static constexpr` -> `static CONSTEXPR_CONST_EXCEPT_WIN_CUDA` (had to make a new macro that was a slight adjustment to an existing one)

This actually took a while to figure out, until I tracked down a previous pytorch PR that encountered a similar issue: #40675

This reverts commit 6d0fb85.



Differential Revision: [D29213932](https://our.internmc.facebook.com/intern/diff/D29213932)

[ghstack-poisoned]
bdhirsh added a commit that referenced this pull request Jun 22, 2021
Reland of #59115, but with a fix for windows cuda builds (example failure in master here: https://github.com/pytorch/pytorch/runs/2852662871)

This is identical to the original PR except for one change in `tools/codegen/gen.py`: `static constexpr` -> `static CONSTEXPR_CONST_EXCEPT_WIN_CUDA` (had to make a new macro that was a slight adjustment to an existing one)

This actually took a while to figure out, until I tracked down a previous pytorch PR that encountered a similar issue: #40675

This reverts commit 6d0fb85.



Differential Revision: [D29213932](https://our.internmc.facebook.com/intern/diff/D29213932)

[ghstack-poisoned]
bdhirsh added a commit that referenced this pull request Jun 24, 2021
Reland of #59115, but with a fix for windows cuda builds (example failure in master here: https://github.com/pytorch/pytorch/runs/2852662871)

This is identical to the original PR except for one change in `tools/codegen/gen.py`: `static constexpr` -> `static CONSTEXPR_CONST_EXCEPT_WIN_CUDA` (had to make a new macro that was a slight adjustment to an existing one)

This actually took a while to figure out, until I tracked down a previous pytorch PR that encountered a similar issue: #40675

This reverts commit 6d0fb85.



Differential Revision: [D29213932](https://our.internmc.facebook.com/intern/diff/D29213932)

[ghstack-poisoned]
bdhirsh added a commit that referenced this pull request Jun 24, 2021
Pull Request resolved: #60214


Relanding this PR, but with a fix for windows cuda builds (example failure in master here: https://github.com/pytorch/pytorch/runs/2852662871)

This is identical to the original PR except for one change in `tools/codegen/gen.py`: `static constexpr` -> `static CONSTEXPR_EXCEPT_WIN_CUDA`

This actually took a while to figure out, until I tracked down a previous pytorch PR that encountered a similar issue: #40675

This reverts commit 6d0fb85.

Differential Revision: [D29213932](https://our.internmc.facebook.com/intern/diff/D29213932/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D29213932/)!
ghstack-source-id: 132130129
bdhirsh added a commit that referenced this pull request Jun 24, 2021
… API""

Reland of #59115, but with a fix for windows cuda builds (example failure in master here: https://github.com/pytorch/pytorch/runs/2852662871)

This is identical to the original PR except for one change in `tools/codegen/gen.py`: `static constexpr` -> `static CONSTEXPR_CONST_EXCEPT_WIN_CUDA` (had to make a new macro that was a slight adjustment to an existing one)

This actually took a while to figure out, until I tracked down a previous pytorch PR that encountered a similar issue: #40675

This reverts commit 6d0fb85.



Differential Revision: [D29213932](https://our.internmc.facebook.com/intern/diff/D29213932)

[ghstack-poisoned]
bdhirsh added a commit that referenced this pull request Jun 24, 2021
Reland of #59115, but with a fix for windows cuda builds (example failure in master here: https://github.com/pytorch/pytorch/runs/2852662871)

This is identical to the original PR except for one change in `tools/codegen/gen.py`: `static constexpr` -> `static CONSTEXPR_CONST_EXCEPT_WIN_CUDA` (had to make a new macro that was a slight adjustment to an existing one)

This actually took a while to figure out, until I tracked down a previous pytorch PR that encountered a similar issue: #40675

This reverts commit 6d0fb85.



Differential Revision: [D29213932](https://our.internmc.facebook.com/intern/diff/D29213932)

[ghstack-poisoned]
bdhirsh added a commit that referenced this pull request Jun 24, 2021
Pull Request resolved: #60214


Relanding this PR, but with a fix for windows cuda builds (example failure in master here: https://github.com/pytorch/pytorch/runs/2852662871)

This is identical to the original PR except for one change in `tools/codegen/gen.py`: `static constexpr` -> `static CONSTEXPR_EXCEPT_WIN_CUDA`

This actually took a while to figure out, until I tracked down a previous pytorch PR that encountered a similar issue: #40675

This reverts commit 6d0fb85.

Differential Revision: [D29213932](https://our.internmc.facebook.com/intern/diff/D29213932/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D29213932/)!
ghstack-source-id: 132300710
facebook-github-bot pushed a commit that referenced this pull request Jun 25, 2021
Summary:
Pull Request resolved: #60214

Relanding this PR, but with a fix for windows cuda builds (example failure in master here: https://github.com/pytorch/pytorch/runs/2852662871)

This is identical to the original PR except for one change in `tools/codegen/gen.py`: `static constexpr` -> `static CONSTEXPR_EXCEPT_WIN_CUDA`

This actually took a while to figure out, until I tracked down a previous pytorch PR that encountered a similar issue: #40675

This reverts commit 6d0fb85.

Test Plan: Imported from OSS

Reviewed By: ezyang

Differential Revision: D29213932

Pulled By: bdhirsh

fbshipit-source-id: b90c7c10e5a51f8d6173ddca673b418e5774c248
asuhan pushed a commit to asuhan/pytorch that referenced this pull request Jun 28, 2021
Summary:
Pull Request resolved: pytorch#60214

Relanding this PR, but with a fix for windows cuda builds (example failure in master here: https://github.com/pytorch/pytorch/runs/2852662871)

This is identical to the original PR except for one change in `tools/codegen/gen.py`: `static constexpr` -> `static CONSTEXPR_EXCEPT_WIN_CUDA`

This actually took a while to figure out, until I tracked down a previous pytorch PR that encountered a similar issue: pytorch#40675

This reverts commit 6d0fb85.

Test Plan: Imported from OSS

Reviewed By: ezyang

Differential Revision: D29213932

Pulled By: bdhirsh

fbshipit-source-id: b90c7c10e5a51f8d6173ddca673b418e5774c248
asuhan pushed a commit that referenced this pull request Jun 30, 2021
Summary:
Pull Request resolved: #60214

Relanding this PR, but with a fix for windows cuda builds (example failure in master here: https://github.com/pytorch/pytorch/runs/2852662871)

This is identical to the original PR except for one change in `tools/codegen/gen.py`: `static constexpr` -> `static CONSTEXPR_EXCEPT_WIN_CUDA`

This actually took a while to figure out, until I tracked down a previous pytorch PR that encountered a similar issue: #40675

This reverts commit 6d0fb85.

Test Plan: Imported from OSS

Reviewed By: ezyang

Differential Revision: D29213932

Pulled By: bdhirsh

fbshipit-source-id: b90c7c10e5a51f8d6173ddca673b418e5774c248
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged oncall: jit Add this issue/PR to JIT oncall triage queue open source

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Combining libtorch C++ api with "pure" cuda code

7 participants