File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
include/boost/compute/algorithm/detail Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -170,8 +170,12 @@ inline size_t bitonic_block_sort(KeyIterator keys_first,
170170 k.decl <bool >(" compare" ) << " = " <<
171171 compare (k.var <key_type>(" sibling_key" ),
172172 k.var <key_type>(" my_key" )) << " ;\n " <<
173+ k.decl <bool >(" equal" ) << " = !(compare || " <<
174+ compare (k.var <key_type>(" my_key" ),
175+ k.var <key_type>(" sibling_key" )) << " );\n " <<
173176 k.decl <bool >(" swap" ) <<
174177 " = compare ^ (sibling_idx < lid) ^ direction;\n " <<
178+ " swap |= equal;\n " <<
175179 " my_key = swap ? sibling_key : my_key;\n " ;
176180 if (sort_by_key)
177181 {
@@ -220,8 +224,12 @@ inline size_t bitonic_block_sort(KeyIterator keys_first,
220224 k.decl <bool >(" compare" ) << " = " <<
221225 compare (k.var <key_type>(" sibling_key" ),
222226 k.var <key_type>(" my_key" )) << " ;\n " <<
227+ k.decl <bool >(" equal" ) << " = !(compare || " <<
228+ compare (k.var <key_type>(" my_key" ),
229+ k.var <key_type>(" sibling_key" )) << " );\n " <<
223230 k.decl <bool >(" swap" ) <<
224231 " = compare ^ (sibling_idx < lid);\n " <<
232+ " swap |= equal;\n " <<
225233 " my_key = swap ? sibling_key : my_key;\n " ;
226234 if (sort_by_key)
227235 {
You can’t perform that action at this time.
0 commit comments