-
Notifications
You must be signed in to change notification settings - Fork 132
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
Restrict CUB device histograms to NUM_ACTIVE_CHANNELS <= NUM_CHANNELS
#1792
Comments
NUM_ACTIVE_CHANNELS <= NUM_CHANNELS
NUM_ACTIVE_CHANNELS <= NUM_CHANNELS
@bernhardmgruber I believe this is an oversight, thank you for spotting this! The documentation states:
Which implies to me that the number of active channels is smaller than the total number of channels. On the implementation side, active channels exceeding num channels leads to OOB access, so catching this use case as a compile-time error is preferrable. Apart from adding a static assert, maybe we could clarify this aspect in documentation as well? |
The
cub::DeviceHistogram::MultiHistogram***
APIs can be compiled and run with more active channels than channels in the input. E.g. having 4 active channels on a 3 channel sample. This leads to interesting results and unit test failures.This rather seems to be by accident than a feature, so I propose disabling it via a
static_assert
.The text was updated successfully, but these errors were encountered: