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

Sort by keys algorithms. More...

Include dependency graph for sort_by_keys.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

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

Functions

template<class Tkey, class Tval>
void shamalgs::primitives::sort_by_key_pow2_len (sycl::queue &q, sycl::buffer< Tkey > &buf_key, sycl::buffer< Tval > &buf_values, u32 len)
 Sort key-value pairs using sycl::buffers (power-of-2 optimized).
template<class Tkey, class Tval>
void shamalgs::primitives::sort_by_key_pow2_len (const sham::DeviceScheduler_ptr &sched, sham::DeviceBuffer< Tkey > &buf_key, sham::DeviceBuffer< Tval > &buf_values, u32 len)
 Sort key-value pairs using USM buffers (power-of-2 optimized).
template<class Tkey, class Tval>
void shamalgs::primitives::sort_by_key (sycl::queue &q, sycl::buffer< Tkey > &buf_key, sycl::buffer< Tval > &buf_values, u32 len)
 Sort key-value pairs using sycl::buffers.
template<class Tkey, class Tval>
void shamalgs::primitives::sort_by_key (const sham::DeviceScheduler_ptr &sched, sham::DeviceBuffer< Tkey > &buf_key, sham::DeviceBuffer< Tval > &buf_values, u32 len)
 Sort key-value pairs using USM buffers.

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)

This header provides parallel sorting algorithms that sort key-value pairs based on the key values. The algorithms are optimized for GPU execution using sycl::buffers or USM.

The sorting functions come in two variants:

  • sort_by_key_pow2_len: Optimized for power-of-2 buffer lengths
  • sort_by_key: General case

Definition in file sort_by_keys.hpp.