Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

error: ‘discard_itr.cub::DiscardOutputIterator<int>::pad[1]’ may be used uninitialized in this function #419

Closed
zasdfgbnm opened this issue Jan 14, 2022 · 0 comments · Fixed by #420
Assignees
Labels
P1: should have Necessary, but not critical. type: bug: functional Does not work as intended.
Milestone

Comments

@zasdfgbnm
Copy link
Contributor

I am seeing the following error when compiling cub

[ 91%] Built target cub.cpp14.test.device_scan_by_key.types_1
/home/gaoxiang/cub/test/test_device_reduce.cu: In function ‘void SolveAndTest(HostInputIteratorT, DeviceInputIteratorT, OffsetT, OffsetT, BeginOffsetIteratorT, EndOffsetIteratorT, BeginOffsetIteratorT, EndOffsetIteratorT, ReductionOpT) [with Backend BACKEND = CUB; OutputValueT = char; HostInputIteratorT = char*; DeviceInputIteratorT = char*; OffsetT = int; BeginOffsetIteratorT = int*; EndOffsetIteratorT = int*; ReductionOpT = cub::Sum]’:
/home/gaoxiang/cub/test/test_device_reduce.cu:871:39: error: ‘discard_itr.cub::DiscardOutputIterator<int>::pad[0]’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
  871 |     DiscardOutputIterator<OffsetT> discard_itr;
      |                                       ^~~~~~~~~  
/home/gaoxiang/cub/test/test_device_reduce.cu:871:39: error: ‘discard_itr.cub::DiscardOutputIterator<int>::pad[1]’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
/home/gaoxiang/cub/test/test_device_reduce.cu:871:39: error: ‘discard_itr.cub::DiscardOutputIterator<int>::pad[2]’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
/home/gaoxiang/cub/test/test_device_reduce.cu: In function ‘void SolveAndTest(HostInputIteratorT, DeviceInputIteratorT, OffsetT, OffsetT, BeginOffsetIteratorT, EndOffsetIteratorT, BeginOffsetIteratorT, EndOffsetIteratorT, ReductionOpT) [with Backend BACKEND = CUB; OutputValueT = unsigned char; HostInputIteratorT = unsigned char*; DeviceInputIteratorT = unsigned char*; OffsetT = int; BeginOffsetIteratorT = int*; EndOffsetIteratorT = int*; ReductionOpT = cub::Sum]’:
/home/gaoxiang/cub/test/test_device_reduce.cu:871:39: error: ‘discard_itr.cub::DiscardOutputIterator<int>::pad[0]’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
/home/gaoxiang/cub/test/test_device_reduce.cu:871:39: error: ‘discard_itr.cub::DiscardOutputIterator<int>::pad[1]’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
/home/gaoxiang/cub/test/test_device_reduce.cu:871:39: error: ‘discard_itr.cub::DiscardOutputIterator<int>::pad[2]’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
/home/gaoxiang/cub/test/test_device_reduce.cu: In function ‘void SolveAndTest(HostInputIteratorT, DeviceInputIteratorT, OffsetT, OffsetT, BeginOffsetIteratorT, EndOffsetIteratorT, BeginOffsetIteratorT, EndOffsetIteratorT, ReductionOpT) [with Backend BACKEND = CUB; OutputValueT = int; HostInputIteratorT = char*; DeviceInputIteratorT = char*; OffsetT = int; BeginOffsetIteratorT = int*; EndOffsetIteratorT = int*; ReductionOpT = cub::Sum]’:
/home/gaoxiang/cub/test/test_device_reduce.cu:871:39: error: ‘discard_itr.cub::DiscardOutputIterator<int>::pad[0]’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
/home/gaoxiang/cub/test/test_device_reduce.cu:871:39: error: ‘discard_itr.cub::DiscardOutputIterator<int>::pad[1]’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
/home/gaoxiang/cub/test/test_device_reduce.cu:871:39: error: ‘discard_itr.cub::DiscardOutputIterator<int>::pad[2]’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
/home/gaoxiang/cub/test/test_device_reduce.cu: In function ‘void TestByOp(HostInputIteratorT, DeviceInputIteratorT, OffsetT, OffsetT, BeginOffsetIteratorT, EndOffsetIteratorT, BeginOffsetIteratorT, EndOffsetIteratorT) [with Backend BACKEND = CUB; OutputT = char; HostInputIteratorT = char*; DeviceInputIteratorT = char*; OffsetT = int; BeginOffsetIteratorT = int*; EndOffsetIteratorT = int*]’:
/home/gaoxiang/cub/test/test_device_reduce.cu:871:39: error: ‘discard_itr.cub::DiscardOutputIterator<int>::pad[0]’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
/home/gaoxiang/cub/test/test_device_reduce.cu:871:39: error: ‘discard_itr.cub::DiscardOutputIterator<int>::pad[1]’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
/home/gaoxiang/cub/test/test_device_reduce.cu:871:39: error: ‘discard_itr.cub::DiscardOutputIterator<int>::pad[2]’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
/home/gaoxiang/cub/test/test_device_reduce.cu:871:39: error: ‘discard_itr.cub::DiscardOutputIterator<int>::pad[0]’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
/home/gaoxiang/cub/test/test_device_reduce.cu:871:39: error: ‘discard_itr.cub::DiscardOutputIterator<int>::pad[1]’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
/home/gaoxiang/cub/test/test_device_reduce.cu:871:39: error: ‘discard_itr.cub::DiscardOutputIterator<int>::pad[2]’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
/home/gaoxiang/cub/test/test_device_reduce.cu:871:39: error: ‘discard_itr.cub::DiscardOutputIterator<int>::pad[0]’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
/home/gaoxiang/cub/test/test_device_reduce.cu:871:39: error: ‘discard_itr.cub::DiscardOutputIterator<int>::pad[1]’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
/home/gaoxiang/cub/test/test_device_reduce.cu:871:39: error: ‘discard_itr.cub::DiscardOutputIterator<int>::pad[2]’ may be used uninitialized in this function [-Werror=maybe-uninitialized]

The following version of compiler are used:

$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Thu_Nov_18_09:45:30_PST_2021
Cuda compilation tools, release 11.5, V11.5.119
Build cuda_11.5.r11.5/compiler.30672275_0

$ gcc-10 --version
gcc-10 (Arch Linux 10.3.0-2) 10.3.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@alliepiper alliepiper self-assigned this Jan 17, 2022
@alliepiper alliepiper added type: bug: functional Does not work as intended. P1: should have Necessary, but not critical. labels Jan 17, 2022
@alliepiper alliepiper added this to the 1.16.0 milestone Jan 17, 2022
alliepiper added a commit to alliepiper/cub that referenced this issue Jan 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P1: should have Necessary, but not critical. type: bug: functional Does not work as intended.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants