-
Notifications
You must be signed in to change notification settings - Fork 318
Labels
bugSomething isn't working right.Something isn't working right.
Description
Is this a duplicate?
- I confirmed there appear to be no duplicate issues for this bug and that I agree to the Code of Conduct
Type of Bug
Runtime Error
Component
libcu++
Describe the bug
bit_ceilcauses overflow in the bit shifts below. The original PR (#4564) calls a customget_cipher_bitswhich is an optimized version ofbit_width.
Originally posted by @leofang in #5530 (comment)
How to Reproduce
Pass 100,000,000 as __num_elements to the constructor to see this.
cccl/libcudacxx/include/cuda/__random/feistel_bijection.h
Lines 58 to 64 in 8136b82
| _CCCL_API __feistel_bijection(uint64_t __num_elements, _RNG&& __gen) | |
| { | |
| const uint64_t __total_bits = (::cuda::std::max) (uint64_t{4}, ::cuda::std::bit_ceil(__num_elements)); | |
| // Half bits rounded down | |
| __left_side_bits = __total_bits / 2; | |
| __left_side_mask = (1ull << __left_side_bits) - 1; |
Expected behavior
The original PR before porting (#4564) was correct.
Reproduction link
No response
Operating System
No response
nvidia-smi output
No response
NVCC version
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't working right.Something isn't working right.
Type
Projects
Status
Done