-
Notifications
You must be signed in to change notification settings - Fork 170
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
Always treat CCCL as system headers #531
Conversation
This should be opt out, not opt in. |
#pragma GCC system_header | ||
#if defined(CCCL_AS_SYSTEM_HEADER) | ||
# define _LIBCUDACXX_IMPLICIT_SYSTEM_HEADER | ||
#elif defined(_LIBCUDACXX_COMPILER_MSVC) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This construction here is needed to keep preexisting behavior.
I decided to overwrite the old _LIBCUDACXX_DISABLE_PRAGMA_MSVC_WARNING
and _LIBCUDACXX_DISABLE_PRAGMA_GCC_SYSTEM_HEADER
behavior in case of CCCL_AS_SYSTEM_HEADER
Shout if you disagree
a85e755
to
3c815cd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments:
suggestion: I prefer self-sufficient headers. Most of the changes add macro to the header containing only CUB includes. It's difficult to prove that the include chain will lead us to libcu++ config. It happens to do so due to namespace macro, but it's implicit. Also, in Thrust, you've included libcu++ config into Thrust config, but this is not done for CUB.
important: this PR has to add _CCCL_NO_SYSTEM_HEADER
definition to Thrust/CUB tests and examples before it's merged.
suggestion: macro was not added to the following headers:
- cub/cub/detail/exec_check_disable.cuh
- cub/cub/detail/detect_cuda_runtime.cuh
- thrust/thrust/detail/memory_wrapper.h
- thrust/thrust/detail/numeric_wrapper.h
- thrust/thrust/detail/config/simple_defines.h
- thrust/thrust/detail/algorithm_wrapper.h
- thrust/thrust/detail/preprocessor.h
- thrust/thrust/version.h
I intentionally tried to keep the changes minimal. Thats why in CUB I only added the include to
That will not work. As it stands, thrust and cub currently require libcu++ as system header because of deprecated symbols. I am absolutely unclear why but I believe that is for another day
I was unsure about the wrapper headers and headers that are purely defining macros, but I can happily add the Macro and the config include to those headers as well |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That will not work. As it stands, thrust and cub currently require libcu++ as system header because of deprecated symbols. I am absolutely unclear why but I believe that is for another day
If it's problematic, I'm fine merging this PR once remaining comments are addressed. But before doing that, please, file an issue, link it here, and prioritize disabling the macro in our tests.
3c815cd
to
ea631db
Compare
@miscco in order to add a sanity test that these changes work as expected, I think we should update the |
0a65b5c
to
1dd8286
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked mainly the implementation of the macros, it seems correct.
8280bfb
to
c167db1
Compare
c167db1
to
29d73f1
Compare
libcudacxx/include/cuda/std/detail/libcxx/include/__cccl/visibility.h
Outdated
Show resolved
Hide resolved
d229d91
to
66a34a0
Compare
f37a430
to
41b46f6
Compare
We just reused the libcu++ config, but going forward we want to move more common parts into a unified config.
…header` nvc++ breaks if we put `#pragma GCC system_header` into a macro. As we really want that macro for compilers that are different than gcc we work around this by special casing nvc++ in the individual header files
41b46f6
to
948f699
Compare
* Expand the use of `system_header` in libcu++ * Add `_CCCL_IMPLICIT_SYSTEM_HEADER` to thrust headers * Add `_CCCL_IMPLICIT_SYSTEM_HEADER` to cub headers
There are users that build with stronger warning levels that we test against or use newer compilers that added warnings
In that case, their build might fail due to warnings emitted by a cccl header.
To work around this user issue we allow users to define
CCCL_AS_SYSTEM_HEADER
to silence all warnings originating from our headersFixes #527