Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
RadixTreeMortonBuilder.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#include "shambackends/sycl.hpp"
23
31template<class morton_t, class pos_t, u32 dim>
33 public:
46 static void build(
47 sycl::queue &queue,
48 std::tuple<pos_t, pos_t> bounding_box,
49 sycl::buffer<pos_t> &pos_buf,
50 u32 cnt_obj,
51 std::unique_ptr<sycl::buffer<morton_t>> &out_buf_morton,
52 std::unique_ptr<sycl::buffer<u32>> &out_buf_particle_index_map);
53
54 static void build(
55 sham::DeviceScheduler_ptr dev_sched,
56 std::tuple<pos_t, pos_t> bounding_box,
58 u32 cnt_obj,
59 std::unique_ptr<sycl::buffer<morton_t>> &out_buf_morton,
60 std::unique_ptr<sycl::buffer<u32>> &out_buf_particle_index_map);
61
71 static void build_raw(
72 sycl::queue &queue,
73 std::tuple<pos_t, pos_t> bounding_box,
74 sycl::buffer<pos_t> &pos_buf,
75 u32 cnt_obj,
76 std::unique_ptr<sycl::buffer<morton_t>> &out_buf_morton);
77};
std::uint32_t u32
32 bit unsigned integer
Helper class to build morton codes.
static void build_raw(sycl::queue &queue, std::tuple< pos_t, pos_t > bounding_box, sycl::buffer< pos_t > &pos_buf, u32 cnt_obj, std::unique_ptr< sycl::buffer< morton_t > > &out_buf_morton)
build a raw mrton table from a position buffer (no sorting & index map)
static void build(sycl::queue &queue, std::tuple< pos_t, pos_t > bounding_box, sycl::buffer< pos_t > &pos_buf, u32 cnt_obj, std::unique_ptr< sycl::buffer< morton_t > > &out_buf_morton, std::unique_ptr< sycl::buffer< u32 > > &out_buf_particle_index_map)
build morton code table for the tree
A buffer allocated in USM (Unified Shared Memory)