-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Out-of-bounds read in reduction_kernel.cu variant reduce6 for array size 1 #21
Comments
@emjotde samples sources are expected to be used as is, modified source bugs are expected. closing this issue. |
It's not really a modified source bug. The bug is there regardless whether I modify it or not. In the very least the algorithm isn't working as advertised in this snippet. Considering that these samples have an encyclopedic role leaving it in there seems borderline irresponsible. This call
will read out of bounds for size 1. |
@emjotde yes this needs to be investigated reopening. thanks for providing details. |
This is fixed now on the tot, closing the issue. |
Hi,
your kernel reduce6 from the reduction example does an out-of-bounds read for trivial input size 1 here:
cuda-samples/Samples/reduction/reduction_kernel.cu
Line 357 in 6be5146
This is caused by determining that size 1 is also a power of 2 here:
cuda-samples/Samples/reduction/reduction.cpp
Line 88 in 6be5146
but incorrectly assuming that we can increase by
blockSize
(==1).Best,
Marcin
The text was updated successfully, but these errors were encountered: