From c0ebecccf9acb10f529a1fc4c8f208cfaa1c36f3 Mon Sep 17 00:00:00 2001 From: Istvan Kiss Date: Tue, 7 May 2019 12:01:14 +0200 Subject: [PATCH] Handle non const operator at merge_sort --- rocprim/include/rocprim/block/detail/block_sort_bitonic.hpp | 2 +- rocprim/include/rocprim/device/detail/device_merge_sort.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rocprim/include/rocprim/block/detail/block_sort_bitonic.hpp b/rocprim/include/rocprim/block/detail/block_sort_bitonic.hpp index f6e043709..717efa640 100644 --- a/rocprim/include/rocprim/block/detail/block_sort_bitonic.hpp +++ b/rocprim/include/rocprim/block/detail/block_sort_bitonic.hpp @@ -227,7 +227,7 @@ class block_sort_bitonic const auto warp_id_is_even = ((flat_tid / ::rocprim::warp_size()) % 2) == 0; ::rocprim::warp_sort wsort; auto compare_function2 = - [compare_function, warp_id_is_even](const Key& a, const Key& b) -> bool + [compare_function, warp_id_is_even](const Key& a, const Key& b) mutable -> bool { auto r = compare_function(a, b); if(warp_id_is_even) diff --git a/rocprim/include/rocprim/device/detail/device_merge_sort.hpp b/rocprim/include/rocprim/device/detail/device_merge_sort.hpp index 55b38ffb7..a2a84fef2 100644 --- a/rocprim/include/rocprim/device/detail/device_merge_sort.hpp +++ b/rocprim/include/rocprim/device/detail/device_merge_sort.hpp @@ -360,7 +360,7 @@ void block_sort_kernel_impl(KeysInputIterator keys_input, ); // Special comparison that preserves relative order of equal keys - auto stable_compare_function = [compare_function](const stable_key_type& a, const stable_key_type& b) -> bool + auto stable_compare_function = [compare_function](const stable_key_type& a, const stable_key_type& b) mutable -> bool { const bool ab = compare_function(rocprim::get<0>(a), rocprim::get<0>(b)); const bool ba = compare_function(rocprim::get<0>(b), rocprim::get<0>(a));