Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
MortonCodeSortedSet.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
19
20namespace shamtree {
21
30 template<class Tmorton, class Tvec, u32 dim = shambase::VectorProperties<Tvec>::dimension>
69
79 template<class Tmorton, class Tvec, u32 dim>
80 MortonCodeSortedSet<Tmorton, Tvec, dim> sort_morton_set(
81 const sham::DeviceScheduler_ptr &dev_sched,
82 MortonCodeSet<Tmorton, Tvec, dim> &&morton_codes_set);
83
95 template<class Tmorton, class Tvec, u32 dim>
96 MortonCodeSortedSet<Tmorton, Tvec, dim> sort_morton_set(
97 const sham::DeviceScheduler_ptr &dev_sched,
98 MortonCodeSet<Tmorton, Tvec, dim> &&morton_codes_set,
99 sham::DeviceBuffer<u32> &&cached_map_morton_id_to_obj_id);
100
101} // namespace shamtree
MortonCodeSortedSet< Tmorton, Tvec, dim > sort_morton_set(const sham::DeviceScheduler_ptr &dev_sched, MortonCodeSet< Tmorton, Tvec, dim > &&morton_codes_set)
Sorts a set of Morton codes and creates a new MortonCodeSortedSet object with the sorted codes and th...
std::uint32_t u32
32 bit unsigned integer
A buffer allocated in USM (Unified Shared Memory)
Class representing a set of Morton codes with associated bounding box and position data.
sham::DeviceBuffer< u32 > map_morton_id_to_obj_id
Device buffer holding the map from sorted Morton code to object id.
MortonCodeSortedSet(shammath::AABB< Tvec > &&bounding_box, u32 &&cnt_obj, u32 &&morton_count, sham::DeviceBuffer< Tmorton > &&sorted_morton_codes, sham::DeviceBuffer< u32 > &&map_morton_id_to_obj_id)
Move constructor from each members.
u32 morton_count
The count of Morton codes in the set (every code after cnt_obj is err_code)
sham::DeviceBuffer< Tmorton > sorted_morton_codes
Device buffer holding the sorted Morton codes.
shammath::AABB< Tvec > bounding_box
The axis-aligned bounding box for the set of positions.
u32 cnt_obj
The count of objects represented in the set.
STL namespace.
Axis-Aligned bounding box.
Definition AABB.hpp:99