You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The same code will compile fine with nvcc (given arch >= 70 flags), but it will generate a bunch of errors and one warning when compiled with MSVC. I've added them at the end of the post.
This seems in conflict with libcu++'s claim: "It provides a heterogeneous implementation of the C++ Standard Library that can be used in and between CPU and GPU code".
In our application, this creates a problem as we include <cuda/std/atomic> indirectly together with pybind for Python bindings, which itself cannot be compiled with nvcc for unrelated reasons.
Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29336 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
main.cpp
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\include\cuda\std\detail\__atomic_generated(13): error C2059: syntax error: 'volatile'
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\include\cuda\std\detail\__atomic_generated(13): error C2589: ':': illegal token on right side of '::'
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\include\cuda\std\detail\__atomic_generated(14): error C2059: syntax error: 'volatile'
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\include\cuda\std\detail\__atomic_generated(14): error C2589: ':': illegal token on right side of '::'
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\include\cuda\std\detail\__atomic_generated(15): error C2059: syntax error: 'volatile'
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\include\cuda\std\detail\__atomic_generated(15): error C2589: ':': illegal token on right side of '::'
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\include\cuda\std\detail\__atomic_generated(742): error C2059: syntax error: 'volatile'
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\include\cuda\std\detail\__atomic_generated(742): error C2589: ':': illegal token on right side of '::'
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\include\cuda\std\detail\__atomic_generated(743): error C2059: syntax error: 'volatile'
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\include\cuda\std\detail\__atomic_generated(743): error C2589: ':': illegal token on right side of '::'
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\include\cuda\std\detail\__atomic_generated(744): error C2059: syntax error: 'volatile'
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\include\cuda\std\detail\__atomic_generated(744): error C2589: ':': illegal token on right side of '::'
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\include\cuda\std\detail\__atomic_generated(1471): error C2059: syntax error: 'volatile'
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\include\cuda\std\detail\__atomic_generated(1471): error C2589: ':': illegal token on right side of '::'
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\include\cuda\std\detail\__atomic_generated(1472): error C2059: syntax error: 'volatile'
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\include\cuda\std\detail\__atomic_generated(1472): error C2589: ':': illegal token on right side of '::'
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\include\cuda\std\detail\__atomic_generated(1473): error C2059: syntax error: 'volatile'
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\include\cuda\std\detail\__atomic_generated(1473): error C2589: ':': illegal token on right side of '::'
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\include\cuda\std\detail\__atomic_derived(151): error C2059: syntax error: 'volatile'
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\include\cuda\std\detail\__atomic_derived(151): error C2589: ':': illegal token on right side of '::'
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\include\cuda\std\detail\../chrono(33): warning C4068: unknown pragma 'diag_suppress'
The text was updated successfully, but these errors were encountered:
As a minimal example, save the following as
main.cpp
and compile with MSVC /cl.exe
, e.g.:cl main.cpp -I "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\include"
The same code will compile fine with nvcc (given arch >= 70 flags), but it will generate a bunch of errors and one warning when compiled with MSVC. I've added them at the end of the post.
This seems in conflict with libcu++'s claim: "It provides a heterogeneous implementation of the C++ Standard Library that can be used in and between CPU and GPU code".
In our application, this creates a problem as we include
<cuda/std/atomic>
indirectly together with pybind for Python bindings, which itself cannot be compiled withnvcc
for unrelated reasons.The text was updated successfully, but these errors were encountered: