"docs-source/vscode:/vscode.git/clone" did not exist on "9d9a3f4fa02ab3b24431c454c5c588c113793fd3"
Commit d527f999 authored by peastman's avatar peastman
Browse files

Fixed incorrect indexing in kernel

parent ff555815
......@@ -23,7 +23,7 @@ DEVICE int reduceMax(int val, LOCAL_ARG int* temp) {
temp[LOCAL_ID] = val;
SYNC_WARPS;
for (int offset = 16; offset > 0; offset /= 2) {
if (offset < indexInWarp)
if (indexInWarp < offset)
temp[LOCAL_ID] = max(temp[LOCAL_ID], temp[LOCAL_ID+offset]);
SYNC_WARPS;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment