Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
sort_by_keys.cpp File Reference

Sort by keys algorithms. More...

Include dependency graph for sort_by_keys.cpp:

Go to the source code of this file.

Classes

struct  shamalgs::primitives::impl::StdSort
 Copy the buffers to host, std::sort the zipped key/value pairs, and copy back. More...
struct  shamalgs::primitives::impl::BatcherOddEvenHostSerial
 Copy the buffers to host, sort with Batcher's odd-even merge sort, and copy back. More...
struct  shamalgs::primitives::impl::BatcherOddEven
 Copy the buffers to host, sort with Batcher's odd-even merge sort, and copy back. More...
struct  shamalgs::primitives::impl::LsdRadixSortBasic

Namespaces

namespace  shamalgs
 namespace to contain everything implemented by shamalgs
namespace  shamalgs::primitives
 namespace for primitive algorithm (e.g. sort, scan, reductions, ...)
namespace  shamalgs::primitives::impl
 namespace to control implementation behavior

Functions

template<class Tkey, class Tval>
void shamalgs::primitives::details::sort_by_keys_batcher_odd_even_host_serial (sham::DeviceBuffer< Tkey > &buf_key, sham::DeviceBuffer< Tval > &buf_values, u32 len)
 shamalgs::primitives::impl::SHAMALGS_REGISTER_IMPL (sort_by_keys_impl_name, sort_by_keys_impl)
template<class Tkey, class Tval>
void shamalgs::primitives::sort_by_keys (sham::DeviceBuffer< Tkey > &buf_key, sham::DeviceBuffer< Tval > &buf_values, u32 len)
 Sort key-value pairs using USM buffers (general length).
template void shamalgs::primitives::sort_by_keys (sham::DeviceBuffer< u32 > &buf_key, sham::DeviceBuffer< u32 > &buf_values, u32 len)
template void shamalgs::primitives::sort_by_keys (sham::DeviceBuffer< u64 > &buf_key, sham::DeviceBuffer< u32 > &buf_values, u32 len)
template void shamalgs::primitives::sort_by_keys (sham::DeviceBuffer< f64 > &buf_key, sham::DeviceBuffer< f64 > &buf_values, u32 len)
template void shamalgs::primitives::sort_by_keys (sham::DeviceBuffer< f32 > &buf_key, sham::DeviceBuffer< f32 > &buf_values, u32 len)

Variables

constexpr std::string_view shamalgs::primitives::impl::sort_by_keys_impl_name = "sort_by_keys"
 Registry name, shared by its registration and the dispatch site(s).
shamalgs::ImplVariantGlobal< StdSort, BatcherOddEvenHostSerial, BatcherOddEven, LsdRadixSortBasic > shamalgs::primitives::impl::sort_by_keys_impl

Detailed Description

Sort by keys algorithms.

Author
Timothée David–Cléris (tim.s.nosp@m.hamr.nosp@m.ock@p.nosp@m.roto.nosp@m.n.me)

Definition in file sort_by_keys.cpp.

Function Documentation

◆ sort_by_keys_batcher_odd_even_host_serial()

template<class Tkey, class Tval>
void shamalgs::primitives::details::sort_by_keys_batcher_odd_even_host_serial ( sham::DeviceBuffer< Tkey > & buf_key,
sham::DeviceBuffer< Tval > & buf_values,
u32 len )
inline

Copy both buffers to host, sort the zipped key/value pairs with batcher_odd_even_host_serial, and copy back

Definition at line 34 of file sort_by_keys.cpp.

Here is the call graph for this function: