Skip to content

Commit 6fc7bea

Browse files
committed
Fix scan_on_cpu algorithm
1 parent 499689d commit 6fc7bea

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/boost/compute/algorithm/detail/scan_on_cpu.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ inline OutputIterator scan_on_cpu(InputIterator first,
7979
"uint block = " <<
8080
"(uint)ceil(((float)count)/(get_global_size(0) + 1));\n" <<
8181
"uint index = get_global_id(0) * block;\n" <<
82-
"uint end = min(count, index + block);\n";
82+
"uint end = min(count, index + block);\n" <<
83+
"if(index >= end) return;\n";
8384

8485
if(!exclusive){
8586
k <<

0 commit comments

Comments
 (0)