| 68 | /// \see sort(), is_sorted() |
| 69 | template<class Iterator, class Compare> |
| 70 | inline void stable_sort(Iterator first, |
| 71 | Iterator last, |
| 72 | Compare compare, |
| 73 | command_queue &queue = system::default_queue()) |
| 74 | { |
| 75 | if(queue.get_device().type() & device::gpu) { |
| 76 | ::boost::compute::detail::dispatch_gpu_stable_sort( |
| 77 | first, last, compare, queue |
| 78 | ); |
| 79 | } |
| 80 | ::boost::compute::detail::merge_sort_on_cpu(first, last, compare, queue); |
| 81 | } |
| 82 | |
| 83 | /// \overload |
| 84 | template<class Iterator> |