-
Notifications
You must be signed in to change notification settings - Fork 446
CUB uses non-standard C++ extensions that break strict compilers #228
Comments
Thanks for pointing this out. I don't see any gcc warning flags for this (other than We should enable that and clean these up. |
I'm going to try fixing this by enabling |
Slipping to 1.12.0, since this won't be done in time for 1.11.0. |
Looks like using
Reported NVBug 3199547 to see if the nvcc folks have any workarounds. |
The good news is that MSVC |
Compiler folks say there is no workaround for We'll have to rely on MSVC's |
The original bug in this issue has been fixed by 39a2172. |
Summary
Some Nvidia teams regularly use CUB with NVRTC, a compiler with a very strict interpretation of C++. CUB currently uses some non-standard language extensions, such as anonymous structs, which break NVRTC compilation. We should build our test harness with compiler flags that audit non-standard extension usages, such as
-Wpedantic
for GCC/Clang and/W4
for MSVC, and remove as many warning suppressions as possible.NVIDIA/cccl#856 may be related, as it is another NVRTC issue.
Deliverables
[1.12]
Enable-Wpedantic
//W4
in our builds and fix the issues identified by these flags.[1.12]
Audit the current warning suppressions and remove any that are hiding functional problems. Such issues should be fixed instead.Original Issue
I've repurposed this existing issue about anonymous structs to a larger purpose of improving C++ standard compliance across Thrust and CUB. The original issue was:
Title: CUB uses anonymous structs which is disallowed in C++
For example see
cub/cub/block/specializations/block_reduce_raking_commutative_only.cuh
Line 98 in ea48955
This is illegal in C++, see for example
https://stackoverflow.com/questions/2253878/why-does-c-disallow-anonymous-structs
This causes issues with nvrtc which is a strict C++ compiler.
The text was updated successfully, but these errors were encountered: