22 template<
class u_morton>
24 void TreeMortonCodes<u_morton>::build(
26 shammath::CoordRange<T> coord_range,
28 sycl::buffer<T> &pos_buf) {
31 this->obj_cnt = obj_cnt;
33 using TProp = shambase::VectorProperties<T>;
37 {coord_range.lower, coord_range.upper},
41 buf_particle_index_map);
44 template<
class u_morton>
46 void TreeMortonCodes<u_morton>::build(
47 sham::DeviceScheduler_ptr dev_sched,
48 shammath::CoordRange<T> coord_range,
50 sham::DeviceBuffer<T> &pos_buf) {
53 this->obj_cnt = obj_cnt;
55 using TProp = shambase::VectorProperties<T>;
59 {coord_range.lower, coord_range.upper},
63 buf_particle_index_map);
66 template<
class u_morton>
70 cmp = cmp && (obj_cnt == rhs.obj_cnt);
72 using namespace shamalgs::primitives;
76 shamsys::instance::get_compute_queue(), *buf_morton, *rhs.buf_morton, obj_cnt);
79 shamsys::instance::get_compute_queue(),
80 *buf_particle_index_map,
81 *rhs.buf_particle_index_map,
91 template void TreeMortonCodes<u32>::build<f64_3>(
93 shammath::CoordRange<f64_3> coord_range,
95 sycl::buffer<f64_3> &pos_buf);
97 template void TreeMortonCodes<u32>::build<f64_3>(
98 sham::DeviceScheduler_ptr dev_sched,
99 shammath::CoordRange<f64_3> coord_range,
101 sham::DeviceBuffer<f64_3> &pos_buf);
104 template void TreeMortonCodes<u32>::build<f32_3>(
106 shammath::CoordRange<f32_3> coord_range,
108 sycl::buffer<f32_3> &pos_buf);
110 template void TreeMortonCodes<u32>::build<f32_3>(
111 sham::DeviceScheduler_ptr dev_sched,
112 shammath::CoordRange<f32_3> coord_range,
114 sham::DeviceBuffer<f32_3> &pos_buf);
117 template void TreeMortonCodes<u32>::build<u64_3>(
119 shammath::CoordRange<u64_3> coord_range,
121 sycl::buffer<u64_3> &pos_buf);
123 template void TreeMortonCodes<u32>::build<u64_3>(
124 sham::DeviceScheduler_ptr dev_sched,
125 shammath::CoordRange<u64_3> coord_range,
127 sham::DeviceBuffer<u64_3> &pos_buf);
130 template void TreeMortonCodes<u64>::build<f64_3>(
132 shammath::CoordRange<f64_3> coord_range,
134 sycl::buffer<f64_3> &pos_buf);
136 template void TreeMortonCodes<u64>::build<f64_3>(
137 sham::DeviceScheduler_ptr dev_sched,
138 shammath::CoordRange<f64_3> coord_range,
140 sham::DeviceBuffer<f64_3> &pos_buf);
143 template void TreeMortonCodes<u64>::build<f32_3>(
145 shammath::CoordRange<f32_3> coord_range,
147 sycl::buffer<f32_3> &pos_buf);
149 template void TreeMortonCodes<u64>::build<f32_3>(
150 sham::DeviceScheduler_ptr dev_sched,
151 shammath::CoordRange<f32_3> coord_range,
153 sham::DeviceBuffer<f32_3> &pos_buf);
156 template void TreeMortonCodes<u64>::build<u64_3>(
158 shammath::CoordRange<u64_3> coord_range,
160 sycl::buffer<u64_3> &pos_buf);
162 template void TreeMortonCodes<u64>::build<u64_3>(
163 sham::DeviceScheduler_ptr dev_sched,
164 shammath::CoordRange<u64_3> coord_range,
166 sham::DeviceBuffer<u64_3> &pos_buf);
169 template void TreeMortonCodes<u64>::build<u32_3>(
171 shammath::CoordRange<u32_3> coord_range,
173 sycl::buffer<u32_3> &pos_buf);
175 template void TreeMortonCodes<u64>::build<u32_3>(
176 sham::DeviceScheduler_ptr dev_sched,
177 shammath::CoordRange<u32_3> coord_range,
179 sham::DeviceBuffer<u32_3> &pos_buf);
182 template void TreeMortonCodes<u64>::build<i64_3>(
184 shammath::CoordRange<i64_3> coord_range,
186 sycl::buffer<i64_3> &pos_buf);
188 template void TreeMortonCodes<u64>::build<i64_3>(
189 sham::DeviceScheduler_ptr dev_sched,
190 shammath::CoordRange<i64_3> coord_range,
192 sham::DeviceBuffer<i64_3> &pos_buf);
195 template void TreeMortonCodes<u32>::build<i64_3>(
197 shammath::CoordRange<i64_3> coord_range,
199 sycl::buffer<i64_3> &pos_buf);
201 template void TreeMortonCodes<u32>::build<i64_3>(
202 sham::DeviceScheduler_ptr dev_sched,
203 shammath::CoordRange<i64_3> coord_range,
205 sham::DeviceBuffer<i64_3> &pos_buf);
208 template void TreeMortonCodes<u32>::build<u32_3>(
210 shammath::CoordRange<u32_3> coord_range,
212 sycl::buffer<u32_3> &pos_buf);
214 template void TreeMortonCodes<u32>::build<u32_3>(
215 sham::DeviceScheduler_ptr dev_sched,
216 shammath::CoordRange<u32_3> coord_range,
218 sham::DeviceBuffer<u32_3> &pos_buf);
Utility to build morton codes for the radix tree.
std::uint32_t u32
32 bit unsigned integer
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
Element-wise equality comparison algorithms for buffers.
bool equals(sycl::queue &q, sycl::buffer< T > &buf1, sycl::buffer< T > &buf2, u32 cnt)
Compare elements between two sycl::buffers for equality.
shambase::details::BasicStackEntry StackEntry
Alias for shambase::details::BasicStackEntry.