Skip to content
Snippets Groups Projects
Commit 4b3b5203 authored by Andreas Klöckner's avatar Andreas Klöckner
Browse files

Fix reduction when no_sync_size <= group_size (spotted by Alex Nitz)

parent 3a2f47fd
No related branches found
No related tags found
No related merge requests found
......@@ -110,7 +110,15 @@ KERNEL = """//CL//
barrier(CLK_LOCAL_MEM_FENCE);
if (lid < ${no_sync_size})
<%
# NB: There's an exact duplicate of this calculation in the
# %while loop below.
new_size = cur_size // 2
assert new_size * 2 == cur_size
%>
if (lid < ${new_size})
{
__local volatile out_type *lvdata = ldata;
% while cur_size > 1:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment