Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
reduction.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
21
22namespace shamalgs::primitives {
23
55 template<class T>
56 T sum(
57 const sham::DeviceScheduler_ptr &sched,
58 const sham::DeviceBuffer<T> &buf1,
59 u32 start_id,
60 u32 end_id);
61
93 template<class T>
94 T min(
95 const sham::DeviceScheduler_ptr &sched,
96 const sham::DeviceBuffer<T> &buf1,
97 u32 start_id,
98 u32 end_id);
99
131 template<class T>
132 T max(
133 const sham::DeviceScheduler_ptr &sched,
134 const sham::DeviceBuffer<T> &buf1,
135 u32 start_id,
136 u32 end_id);
137
139 namespace impl {
140
142 std::vector<shamalgs::impl_param> get_default_impl_list_reduction();
143
146
148 void set_impl_reduction(const std::string &impl, const std::string &param = "");
149
150 } // namespace impl
151
152} // namespace shamalgs::primitives
std::uint32_t u32
32 bit unsigned integer
A buffer allocated in USM (Unified Shared Memory)
void set_impl_reduction(const std::string &impl, const std::string &param="")
Set the implementation for reduction.
Definition reduction.cpp:99
std::vector< shamalgs::impl_param > get_default_impl_list_reduction()
Get list of available reduction implementations.
Definition reduction.cpp:84
shamalgs::impl_param get_current_impl_reduction()
Get the current implementation for reduction.
Definition reduction.cpp:95
namespace for primitive algorithm (e.g. sort, scan, reductions, ...)