24 template<
class Tmorton,
class Tvec, u32 dim>
26 const sham::DeviceScheduler_ptr &dev_sched,
36 morton_codes_set.cnt_obj,
37 morton_codes_set.sorted_morton_codes,
40 shamlog_debug_sycl_ln(
42 "reduction results : (before :",
43 morton_codes_set.cnt_obj,
45 res.morton_leaf_count,
48 "%2.2f",
f32(morton_codes_set.cnt_obj) /
f32(res.morton_leaf_count)));
50 if (res.morton_leaf_count == 0) {
58 = std::forward<sham::DeviceBuffer<Tmorton>>(cache_reduced_morton_codes);
59 buf_tree_morton.
resize(res.morton_leaf_count);
62 dev_sched->get_queue(),
63 res.morton_leaf_count,
64 res.buf_reduc_index_map,
65 morton_codes_set.sorted_morton_codes,
70 res.morton_leaf_count,
71 std::move(res.buf_reduc_index_map),
72 std::move(buf_tree_morton));
75 template<
class Tmorton,
class Tvec, u32 dim>
77 const sham::DeviceScheduler_ptr &dev_sched,
79 u32 reduction_level) {
95 const sham::DeviceScheduler_ptr &dev_sched,
99 const sham::DeviceScheduler_ptr &dev_sched,
101 u32 reduction_level);
104 const sham::DeviceScheduler_ptr &dev_sched,
110 const sham::DeviceScheduler_ptr &dev_sched,
MortonReducedSet< Tmorton, Tvec, dim > reduce_morton_set(const sham::DeviceScheduler_ptr &dev_sched, MortonCodeSortedSet< Tmorton, Tvec, dim > &&morton_codes_set, u32 reduction_level)
Reduces the given Morton code set by grouping together Morton codes that are close to each other in t...
float f32
Alias for float.
std::uint32_t u32
32 bit unsigned integer
A buffer allocated in USM (Unified Shared Memory)
void resize(size_t new_size, bool keep_data=true)
Resizes the buffer to a given size.
Class representing a set of Morton codes with associated bounding box and position data.
Class representing a set of Morton codes with associated bounding box and position data that was redu...
main include file for the shamalgs algorithms
void throw_with_loc(std::string message, SourceLocation loc=SourceLocation{})
Throw an exception and append the source location to it.
void sycl_morton_remap_reduction(sycl::queue &queue, u32 morton_leaf_count, std::unique_ptr< sycl::buffer< u32 > > &buf_reduc_index_map, std::unique_ptr< sycl::buffer< u_morton > > &buf_morton, std::unique_ptr< sycl::buffer< u_morton > > &buf_leaf_morton)
Remaps a Morton tree on device using a reduction index map.
void reduction_alg(sycl::queue &queue, u32 morton_count, std::unique_ptr< sycl::buffer< u_morton > > &buf_morton, u32 reduction_level, std::unique_ptr< sycl::buffer< u32 > > &buf_reduc_index_map, u32 &morton_leaf_count)
Reduces a Morton tree on device.
Return type of reduction algorithms.