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

Implementation of the digit histogram primitive. More...

#include "shamalgs/primitives/digit_histogram.hpp"
#include "shambase/exception.hpp"
#include "shambase/integer.hpp"
#include "shambase/narrowing.hpp"
#include "shambackends/kernel_call.hpp"
#include "shambackends/sycl.hpp"
#include <type_traits>
#include <algorithm>
Include dependency graph for digit_histogram.cpp:

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, ...)

Macros

#define X(Tkey, radix_bits)

Functions

template<class Tkey, u32 radix_bits>
void shamalgs::primitives::digit_histogram (const sham::DeviceScheduler_ptr &sched, const sham::DeviceBuffer< Tkey > &buf_key, sham::DeviceBuffer< u32 > &buf_hist, u32 len)
 Compute the histograms of all the digit places of the first len keys.
template<class Tkey, u32 radix_bits>
void shamalgs::primitives::digit_histogram (const sham::DeviceScheduler_ptr &sched, const sham::DeviceBuffer< Tkey > &buf_key, sham::DeviceBuffer< u32 > &buf_hist)
 Compute the histograms of all the digit places of every key of buf_key.
template void shamalgs::primitives::digit_histogram< u32, 1 > (const sham::DeviceScheduler_ptr &sched, const sham::DeviceBuffer< u32 > &buf_key, sham::DeviceBuffer< u32 > &buf_hist, u32 len)
template void shamalgs::primitives::digit_histogram< u32, 1 > (const sham::DeviceScheduler_ptr &sched, const sham::DeviceBuffer< u32 > &buf_key, sham::DeviceBuffer< u32 > &buf_hist)
template void shamalgs::primitives::digit_histogram< u32, 2 > (const sham::DeviceScheduler_ptr &sched, const sham::DeviceBuffer< u32 > &buf_key, sham::DeviceBuffer< u32 > &buf_hist, u32 len)
template void shamalgs::primitives::digit_histogram< u32, 2 > (const sham::DeviceScheduler_ptr &sched, const sham::DeviceBuffer< u32 > &buf_key, sham::DeviceBuffer< u32 > &buf_hist)
template void shamalgs::primitives::digit_histogram< u32, 4 > (const sham::DeviceScheduler_ptr &sched, const sham::DeviceBuffer< u32 > &buf_key, sham::DeviceBuffer< u32 > &buf_hist, u32 len)
template void shamalgs::primitives::digit_histogram< u32, 4 > (const sham::DeviceScheduler_ptr &sched, const sham::DeviceBuffer< u32 > &buf_key, sham::DeviceBuffer< u32 > &buf_hist)
template void shamalgs::primitives::digit_histogram< u32, 8 > (const sham::DeviceScheduler_ptr &sched, const sham::DeviceBuffer< u32 > &buf_key, sham::DeviceBuffer< u32 > &buf_hist, u32 len)
template void shamalgs::primitives::digit_histogram< u32, 8 > (const sham::DeviceScheduler_ptr &sched, const sham::DeviceBuffer< u32 > &buf_key, sham::DeviceBuffer< u32 > &buf_hist)
template void shamalgs::primitives::digit_histogram< u64, 1 > (const sham::DeviceScheduler_ptr &sched, const sham::DeviceBuffer< u64 > &buf_key, sham::DeviceBuffer< u32 > &buf_hist, u32 len)
template void shamalgs::primitives::digit_histogram< u64, 1 > (const sham::DeviceScheduler_ptr &sched, const sham::DeviceBuffer< u64 > &buf_key, sham::DeviceBuffer< u32 > &buf_hist)
template void shamalgs::primitives::digit_histogram< u64, 2 > (const sham::DeviceScheduler_ptr &sched, const sham::DeviceBuffer< u64 > &buf_key, sham::DeviceBuffer< u32 > &buf_hist, u32 len)
template void shamalgs::primitives::digit_histogram< u64, 2 > (const sham::DeviceScheduler_ptr &sched, const sham::DeviceBuffer< u64 > &buf_key, sham::DeviceBuffer< u32 > &buf_hist)
template void shamalgs::primitives::digit_histogram< u64, 4 > (const sham::DeviceScheduler_ptr &sched, const sham::DeviceBuffer< u64 > &buf_key, sham::DeviceBuffer< u32 > &buf_hist, u32 len)
template void shamalgs::primitives::digit_histogram< u64, 4 > (const sham::DeviceScheduler_ptr &sched, const sham::DeviceBuffer< u64 > &buf_key, sham::DeviceBuffer< u32 > &buf_hist)
template void shamalgs::primitives::digit_histogram< u64, 8 > (const sham::DeviceScheduler_ptr &sched, const sham::DeviceBuffer< u64 > &buf_key, sham::DeviceBuffer< u32 > &buf_hist, u32 len)
template void shamalgs::primitives::digit_histogram< u64, 8 > (const sham::DeviceScheduler_ptr &sched, const sham::DeviceBuffer< u64 > &buf_key, sham::DeviceBuffer< u32 > &buf_hist)

Detailed Description

Implementation of the digit histogram primitive.

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 digit_histogram.cpp.

Macro Definition Documentation

◆ X

#define X ( Tkey,
radix_bits )
Value:
template void digit_histogram<Tkey, radix_bits>( \
const sham::DeviceScheduler_ptr &sched, \
const sham::DeviceBuffer<Tkey> &buf_key, \
u32 len); \
template void digit_histogram<Tkey, radix_bits>( \
const sham::DeviceScheduler_ptr &sched, \
const sham::DeviceBuffer<Tkey> &buf_key, \
std::uint32_t u32
32 bit unsigned integer
A buffer allocated in USM (Unified Shared Memory).

Definition at line 135 of file digit_histogram.cpp.