diff --git a/include/boost/compute/algorithm/detail/merge_sort_on_gpu.hpp b/include/boost/compute/algorithm/detail/merge_sort_on_gpu.hpp index e62c6beb..2acef1e5 100644 --- a/include/boost/compute/algorithm/detail/merge_sort_on_gpu.hpp +++ b/include/boost/compute/algorithm/detail/merge_sort_on_gpu.hpp @@ -418,7 +418,7 @@ inline void merge_blocks_on_gpu(KeyIterator keys_first, ");\n" << "left_idx = equal ? mid_idx + 1 : left_idx + 1;\n" << "right_idx = equal ? right_idx : mid_idx;\n" << - "upper_key = equal ? upper_key : " << + "upper_key = " << keys_first[k.var("left_idx")] << ";\n" << "}\n" << "}\n" <<