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

Build warnings in <cuda/std/barrier> #998

Open
sleeepyjack opened this issue Aug 5, 2022 · 13 comments
Open

Build warnings in <cuda/std/barrier> #998

sleeepyjack opened this issue Aug 5, 2022 · 13 comments
Assignees
Labels
libcu++ For all items related to libcu++

Comments

@sleeepyjack
Copy link
Contributor

Having build warnings when CMAKE_CUDA_ARCHITECTURES=75:

[ 98%] Linking CXX executable DYNAMIC_MAP_TEST
[ 98%] Built target DYNAMIC_MAP_TEST
/home/yunsongw/miniconda3/include/rapids/libcudacxx/cuda/std/barrier: In function ‘void cuda::__4::init(cuda::__4::barrier<cuda::std::__4::__detail::thread_scope_block>*, ptrdiff_t, cuda::std::__4::__empty_completion)’:
/home/yunsongw/miniconda3/include/rapids/libcudacxx/cuda/std/barrier:158:155: warning: unused parameter ‘__completion’ [-Wunused-parameter]
  158 |     friend void init(barrier * __b, std::ptrdiff_t __expected, std::__empty_completion __completion = std::__empty_completion()) {
      |                                                                                                                        ~~~~~~~~~~~                        ^                                                  
/home/yunsongw/miniconda3/include/rapids/libcudacxx/cuda/std/barrier: In function ‘void cuda::__4::init(cuda::__4::barrier<cuda::std::__4::__detail::thread_scope_block>*, ptrdiff_t, cuda::std::__4::__empty_completion)’:
/home/yunsongw/miniconda3/include/rapids/libcudacxx/cuda/std/barrier:158:155: warning: unused parameter ‘__completion’ [-Wunused-parameter]
  158 |     friend void init(barrier * __b, std::ptrdiff_t __expected, std::__empty_completion __completion = std::__empty_completion()) {
      |                                                                                                                        ~~~~~~~~~~~                        ^                                                  
/home/yunsongw/miniconda3/include/rapids/libcudacxx/cuda/std/barrier: In function ‘void cuda::__4::init(cuda::__4::barrier<cuda::std::__4::__detail::thread_scope_block>*, ptrdiff_t, cuda::std::__4::__empty_completion)’:
/home/yunsongw/miniconda3/include/rapids/libcudacxx/cuda/std/barrier:158:155: warning: unused parameter ‘__completion’ [-Wunused-parameter]
  158 |     friend void init(barrier * __b, std::ptrdiff_t __expected, std::__empty_completion __completion = std::__empty_completion()) {
      |                                                                                                                        ~~~~~~~~~~~                        ^                                                  

Worthing reporting to libcudacxx.

Otherwise, LGTM.

Originally posted by @PointKernel in NVIDIA/cuCollections#201 (review)

@PointKernel
Copy link
Member

Any updates on this issue?

I can put up a PR removing the argument __completion since it seems never to be used but not sure if it's the expected solution.
https://github.com/NVIDIA/libcudacxx/blob/31eadca674f62dca7535734c6aae8a1f082b2259/include/cuda/std/barrier#L158-L171

@jrhemstad
Copy link
Collaborator

@davedsth can you look at this?

@wmaxey
Copy link
Member

wmaxey commented Sep 28, 2022

Unsure if we have internal changes pending that might fix this. David might know more.

@davedsth
Copy link

Internal changes are coming but we haven't addressed the completion arguments
Removing it until we have API + test sounds reasonable

@PointKernel
Copy link
Member

Updates: unused parameters are growing

/home/yunsongw/Work/cuCollections/build/_deps/libcudacxx-src/lib/cmake/libcudacxx/../../../include/cuda/std/barrier: In function ‘void cuda::__4::init(cuda::__4::barrier<cuda::std::__4::__detail::thread_scope_block>*, ptrdiff_t, cuda::std::__4::__empty_completion)’:
/home/yunsongw/Work/cuCollections/build/_deps/libcudacxx-src/lib/cmake/libcudacxx/../../../include/cuda/std/barrier:143:155: warning: unused parameter ‘__completion’ [-Wunused-parameter]
  143 |     friend void init(barrier * __b, std::ptrdiff_t __expected, std::__empty_completion __completion = std::__empty_completion()) {
      |                                                                                                                        ~~~~~~~~~~~                        ^                                                  
/home/yunsongw/Work/cuCollections/build/_deps/libcudacxx-src/lib/cmake/libcudacxx/../../../include/cuda/std/barrier: In member function ‘bool cuda::__4::barrier<cuda::std::__4::__detail::thread_scope_block>::__test_wait_sm_80(cuda::__4::barrier<cuda::std::__4::__detail::thread_scope_block>::arrival_token) const’:
/home/yunsongw/Work/cuCollections/build/_deps/libcudacxx-src/lib/cmake/libcudacxx/../../../include/cuda/std/barrier:247:47: warning: unused parameter ‘__token’ [-Wunused-parameter]
  247 |     inline bool __test_wait_sm_80(arrival_token __token) const {
      |                                 ~~~~~~~~~~~~~~^~~~~~~
/home/yunsongw/Work/cuCollections/build/_deps/libcudacxx-src/lib/cmake/libcudacxx/../../../include/cuda/std/barrier: In member function ‘bool cuda::__4::barrier<cuda::std::__4::__detail::thread_scope_block>::__test_wait_parity_sm_80(bool) const’:
/home/yunsongw/Work/cuCollections/build/_deps/libcudacxx-src/lib/cmake/libcudacxx/../../../include/cuda/std/barrier:357:36: warning: unused parameter ‘__phase_parity’ [-Wunused-parameter]
  357 |     inline bool __test_wait_parity_sm_80(bool __phase_parity) const {

It was only __completion before, now I can see __token and __phase_parity as well.

@wmaxey
Copy link
Member

wmaxey commented Feb 16, 2023

@PointKernel Which version of libcu++ is this? Can you provide info on the compiler, flags, and how barrier is instatiated?

@PointKernel
Copy link
Member

libcu++ version: branch/1.9.1
CXX compiler: GNU 10.3.0
CUDA compiler: NVCC 11.8.89

compiler flag and build log:

cd /home/yunsongw/Work/cuCollections/build/examples && /usr/local/cuda/bin/nvcc -forward-unknown-to-host-compiler -DTHRUST_DEVICE_SYSTEM=THRUST_DEVICE_SYSTEM_CUDA -DTHRUST_HOST_SYSTEM=THRUST_HOST_SYSTEM_CPP -I/home/yunsongw/Work/cuCollections/examples -I/home/yunsongw/Work/cuCollections/include -I/home/yunsongw/Work/cuCollections/build/_deps/libcudacxx-src/lib/cmake/libcudacxx/../../../include -I/home/yunsongw/Work/cuCollections/build/_deps/thrust-src -I/home/yunsongw/Work/cuCollections/build/_deps/thrust-src/dependencies/cub -isystem=/usr/local/cuda/include -O3 -DNDEBUG --generate-code=arch=compute_75,code=[compute_75,sm_75] --compiler-options=-Wall --compiler-options=-Wextra --expt-extended-lambda --expt-relaxed-constexpr -Xcompiler -Wno-subobject-linkage -std=c++17 -MD -MT examples/CMakeFiles/STATIC_SET_HOST_BULK_EXAMPLE.dir/static_set/host_bulk_example.cu.o -MF CMakeFiles/STATIC_SET_HOST_BULK_EXAMPLE.dir/static_set/host_bulk_example.cu.o.d -x cu -c /home/yunsongw/Work/cuCollections/examples/static_set/host_bulk_example.cu -o CMakeFiles/STATIC_SET_HOST_BULK_EXAMPLE.dir/static_set/host_bulk_example.cu.o
/home/yunsongw/Work/cuCollections/build/_deps/libcudacxx-src/lib/cmake/libcudacxx/../../../include/cuda/std/barrier: In function ‘void cuda::__4::init(cuda::__4::barrier<cuda::std::__4::__detail::thread_scope_block>*, ptrdiff_t, cuda::std::__4::__empty_completion)’:
/home/yunsongw/Work/cuCollections/build/_deps/libcudacxx-src/lib/cmake/libcudacxx/../../../include/cuda/std/barrier:143:155: warning: unused parameter ‘__completion’ [-Wunused-parameter]
  143 |     friend void init(barrier * __b, std::ptrdiff_t __expected, std::__empty_completion __completion = std::__empty_completion()) {
      |                                                                                                                        ~~~~~~~~~~~                        ^                                                  
/home/yunsongw/Work/cuCollections/build/_deps/libcudacxx-src/lib/cmake/libcudacxx/../../../include/cuda/std/barrier: In member function ‘bool cuda::__4::barrier<cuda::std::__4::__detail::thread_scope_block>::__test_wait_sm_80(cuda::__4::barrier<cuda::std::__4::__detail::thread_scope_block>::arrival_token) const’:
/home/yunsongw/Work/cuCollections/build/_deps/libcudacxx-src/lib/cmake/libcudacxx/../../../include/cuda/std/barrier:247:47: warning: unused parameter ‘__token’ [-Wunused-parameter]
  247 |     inline bool __test_wait_sm_80(arrival_token __token) const {
      |                                 ~~~~~~~~~~~~~~^~~~~~~
/home/yunsongw/Work/cuCollections/build/_deps/libcudacxx-src/lib/cmake/libcudacxx/../../../include/cuda/std/barrier: In member function ‘bool cuda::__4::barrier<cuda::std::__4::__detail::thread_scope_block>::__test_wait_parity_sm_80(bool) const’:
/home/yunsongw/Work/cuCollections/build/_deps/libcudacxx-src/lib/cmake/libcudacxx/../../../include/cuda/std/barrier:357:36: warning: unused parameter ‘__phase_parity’ [-Wunused-parameter]
  357 |     inline bool __test_wait_parity_sm_80(bool __phase_parity) const {
      |                               ~~~~~^~~~~~~~~~~~~~

The warnings come out even we just include the header but not use it, here is the godbolt repro: https://godbolt.org/z/dzq6orsW3

@wmaxey
Copy link
Member

wmaxey commented Feb 17, 2023

Perfect! Thank you for the repro!

@jrhemstad jrhemstad added thrust For all items related to Thrust. libcu++ For all items related to libcu++ and removed thrust For all items related to Thrust. labels Feb 22, 2023
@miscco
Copy link
Collaborator

miscco commented Feb 23, 2023

@PointKernel could you please verify that the issue is gone with ToT?

@PointKernel
Copy link
Member

I don't see these warnings anymore. Thanks! @miscco @wmaxey

@PointKernel
Copy link
Member

Somehow this issue came out again with recent CTK, e.g. https://godbolt.org/z/fGEocq58T.

@miscco
Copy link
Collaborator

miscco commented Aug 22, 2023

That looks like a old library version. There is no line 143 in <cuda/std/barrier>

@wmaxey those changes should be in 12.1 shouldnt they?

@PointKernel
Copy link
Member

PointKernel commented Aug 22, 2023

To provide more information on this issue. If you check our CI run details,

And we are fetching the same version of libcudacxx in both cases:

-- CPM: adding package [email protected] (branch/1.9.1)
-- Found libcudacxx: /home/coder/cuCollections/build/local/_deps/libcudacxx-src/lib/cmake/libcudacxx/libcudacxx-config.cmake (found version "1.9.1.0") 

@github-project-automation github-project-automation bot moved this to Todo in CCCL Nov 8, 2023
@jarmak-nv jarmak-nv transferred this issue from NVIDIA/libcudacxx Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libcu++ For all items related to libcu++
Projects
Status: Todo
Development

No branches or pull requests

8 participants