Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
sort_by_keys.hpp
Go to the documentation of this file.
1// -------------------------------------------------------//
2//
3// SHAMROCK code for hydrodynamics
4// Copyright (c) 2021-2026 Timothée David--Cléris <tim.shamrock@proton.me>
5// SPDX-License-Identifier: CeCILL Free Software License Agreement v2.1
6// Shamrock is licensed under the CeCILL 2.1 License, see LICENSE for more information
7//
8// -------------------------------------------------------//
9
10#pragma once
11
23
26#include <string>
27#include <vector>
28
29namespace shamalgs::primitives {
30
49 template<class Tkey, class Tval>
50 void sort_by_keys(
51 sham::DeviceBuffer<Tkey> &buf_key, sham::DeviceBuffer<Tval> &buf_values, u32 len);
52
54 namespace impl {
55
57 std::vector<std::string> get_default_impl_list_sort_by_keys();
58
61
64
66 void set_impl_sort_by_keys(const std::string &impl);
67
69 void autoselect_impl_sort_by_keys(const sham::DeviceScheduler_ptr &dev_sched);
70
71 } // namespace impl
72
73} // namespace shamalgs::primitives
std::uint32_t u32
32 bit unsigned integer
namespace to control implementation behavior
std::vector< std::string > get_default_impl_list_sort_by_keys()
Get list of available sort by keys implementations, as config json strings.
std::string get_current_impl_sort_by_keys()
Get the current implementation for sort by keys, as a config json string.
void autoselect_impl_sort_by_keys(const sham::DeviceScheduler_ptr &dev_sched)
Select the default implementation for sort by keys.
void set_impl_sort_by_keys(const std::string &impl)
Set the implementation for sort by keys, from a config json string.
bool is_impl_set_sort_by_keys()
Check if an implementation has been selected for sort by keys.
namespace for primitive algorithm (e.g. sort, scan, reductions, ...)
void sort_by_keys(sham::DeviceBuffer< Tkey > &buf_key, sham::DeviceBuffer< Tval > &buf_values, u32 len)
Sort key-value pairs using USM buffers (general length).