26 std::unique_ptr<sycl::buffer<u32>> buf_reduc_index_map;
27 std::unique_ptr<sycl::buffer<u_morton>> buf_tree_morton;
37 [[nodiscard]]
inline u64 memsize()
const {
40 sum +=
sizeof(tree_leaf_count);
42 auto add_ptr = [&](
auto &a) {
44 sum += a->byte_size();
48 add_ptr(buf_reduc_index_map);
49 add_ptr(buf_tree_morton);
57 : tree_leaf_count(other.tree_leaf_count),
59 shamalgs::memory::duplicate(
60 shamsys::instance::get_compute_queue(), other.buf_reduc_index_map)),
62 shamalgs::memory::duplicate(
63 shamsys::instance::get_compute_queue(), other.buf_tree_morton)) {}
66 tree_leaf_count = std::move(other.tree_leaf_count);
67 buf_reduc_index_map = std::move(other.buf_reduc_index_map);
68 buf_tree_morton = std::move(other.buf_tree_morton);
83 serializer.write(tree_leaf_count);
84 if (!buf_reduc_index_map) {
87 serializer.write<
u32>(buf_reduc_index_map->size());
88 serializer.write_buf(*buf_reduc_index_map, buf_reduc_index_map->size());
89 if (!buf_tree_morton) {
92 serializer.write_buf(*buf_tree_morton, tree_leaf_count);
98 TreeReducedMortonCodes ret;
99 serializer.load(ret.tree_leaf_count);
102 serializer.load(tmp);
104 ret.buf_reduc_index_map = std::make_unique<sycl::buffer<u32>>(tmp);
105 ret.buf_tree_morton = std::make_unique<sycl::buffer<u_morton>>(ret.tree_leaf_count);
107 serializer.load_buf(*ret.buf_reduc_index_map, tmp);
108 serializer.load_buf(*ret.buf_tree_morton, ret.tree_leaf_count);
117 return H::serialize_byte_size<u32>() * 2
118 + H::serialize_byte_size<u32>(buf_reduc_index_map->size())
119 + H::serialize_byte_size<u_morton>(tree_leaf_count);