File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed
include/boost/compute/algorithm/detail Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -76,8 +76,7 @@ inline OutputIterator scan_on_cpu(InputIterator first,
7676 k.add_arg <output_type *>(memory_object::global_memory, " block_partial_sums" );
7777
7878 k <<
79- " uint block = " <<
80- " (uint)ceil(((float)count)/(get_global_size(0) + 1));\n " <<
79+ " uint block = (count + get_global_size(0))/(get_global_size(0) + 1);\n " <<
8180 " uint index = get_global_id(0) * block;\n " <<
8281 " uint end = min(count, index + block);\n " <<
8382 " if(index >= end) return;\n " ;
@@ -155,11 +154,9 @@ inline OutputIterator scan_on_cpu(InputIterator first,
155154 l.add_arg <output_type *>(memory_object::global_memory, " block_partial_sums" );
156155
157156 l <<
158- " uint block = " <<
159- " (uint)ceil(((float)count)/(get_global_size(0) + 1));\n " <<
157+ " uint block = (count + get_global_size(0))/(get_global_size(0) + 1);\n " <<
160158 " uint index = block + get_global_id(0) * block;\n " <<
161159 " uint end = min(count, index + block);\n " <<
162-
163160 k.decl <output_type>(" sum" ) << " = block_partial_sums[0];\n " <<
164161 " for(uint i = 0; i < get_global_id(0); i++) {\n " <<
165162 " sum = " << op (k.var <output_type>(" sum" ),
You can’t perform that action at this time.
0 commit comments