22 template<
class u_morton>
24 void TreeMortonCodes<u_morton>::build(
28 sycl::buffer<T> &pos_buf) {
31 this->obj_cnt = obj_cnt;
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,
53 this->obj_cnt = obj_cnt;
59 {coord_range.lower, coord_range.upper},
63 buf_particle_index_map);
66 template<
class u_morton>
68 std::unique_ptr<sycl::buffer<u_morton>> TreeMortonCodes<u_morton>::build_raw(
72 sycl::buffer<T> &pos_buf) {
74 std::unique_ptr<sycl::buffer<u_morton>> buf_morton;
81 queue, {coord_range.lower, coord_range.upper}, pos_buf, obj_cnt, buf_morton);
86 template<
class u_morton>
87 bool TreeMortonCodes<u_morton>::operator==(
const TreeMortonCodes<u_morton> &rhs)
const {
90 cmp = cmp && (obj_cnt == rhs.obj_cnt);
96 shamsys::instance::get_compute_queue(), *buf_morton, *rhs.buf_morton, obj_cnt);
99 shamsys::instance::get_compute_queue(),
100 *buf_particle_index_map,
101 *rhs.buf_particle_index_map,
107 template class TreeMortonCodes<u32>;
108 template class TreeMortonCodes<u64>;
111 template void TreeMortonCodes<u32>::build<f64_3>(
115 sycl::buffer<f64_3> &pos_buf);
117 template void TreeMortonCodes<u32>::build<f64_3>(
118 sham::DeviceScheduler_ptr dev_sched,
123 template std::unique_ptr<sycl::buffer<u32>> TreeMortonCodes<u32>::build_raw<f64_3>(
127 sycl::buffer<f64_3> &pos_buf);
130 template void TreeMortonCodes<u32>::build<f32_3>(
134 sycl::buffer<f32_3> &pos_buf);
136 template void TreeMortonCodes<u32>::build<f32_3>(
137 sham::DeviceScheduler_ptr dev_sched,
142 template std::unique_ptr<sycl::buffer<u32>> TreeMortonCodes<u32>::build_raw<f32_3>(
146 sycl::buffer<f32_3> &pos_buf);
149 template void TreeMortonCodes<u32>::build<u64_3>(
153 sycl::buffer<u64_3> &pos_buf);
155 template void TreeMortonCodes<u32>::build<u64_3>(
156 sham::DeviceScheduler_ptr dev_sched,
161 template std::unique_ptr<sycl::buffer<u32>> TreeMortonCodes<u32>::build_raw<u64_3>(
165 sycl::buffer<u64_3> &pos_buf);
168 template void TreeMortonCodes<u64>::build<f64_3>(
172 sycl::buffer<f64_3> &pos_buf);
174 template void TreeMortonCodes<u64>::build<f64_3>(
175 sham::DeviceScheduler_ptr dev_sched,
180 template std::unique_ptr<sycl::buffer<u64>> TreeMortonCodes<u64>::build_raw<f64_3>(
184 sycl::buffer<f64_3> &pos_buf);
187 template void TreeMortonCodes<u64>::build<f32_3>(
191 sycl::buffer<f32_3> &pos_buf);
193 template void TreeMortonCodes<u64>::build<f32_3>(
194 sham::DeviceScheduler_ptr dev_sched,
199 template std::unique_ptr<sycl::buffer<u64>> TreeMortonCodes<u64>::build_raw<f32_3>(
203 sycl::buffer<f32_3> &pos_buf);
206 template void TreeMortonCodes<u64>::build<u64_3>(
210 sycl::buffer<u64_3> &pos_buf);
212 template void TreeMortonCodes<u64>::build<u64_3>(
213 sham::DeviceScheduler_ptr dev_sched,
218 template std::unique_ptr<sycl::buffer<u64>> TreeMortonCodes<u64>::build_raw<u64_3>(
222 sycl::buffer<u64_3> &pos_buf);
225 template void TreeMortonCodes<u64>::build<u32_3>(
229 sycl::buffer<u32_3> &pos_buf);
231 template void TreeMortonCodes<u64>::build<u32_3>(
232 sham::DeviceScheduler_ptr dev_sched,
237 template std::unique_ptr<sycl::buffer<u64>> TreeMortonCodes<u64>::build_raw<u32_3>(
241 sycl::buffer<u32_3> &pos_buf);
244 template void TreeMortonCodes<u64>::build<i64_3>(
248 sycl::buffer<i64_3> &pos_buf);
250 template void TreeMortonCodes<u64>::build<i64_3>(
251 sham::DeviceScheduler_ptr dev_sched,
256 template std::unique_ptr<sycl::buffer<u64>> TreeMortonCodes<u64>::build_raw<i64_3>(
260 sycl::buffer<i64_3> &pos_buf);
263 template void TreeMortonCodes<u32>::build<i64_3>(
267 sycl::buffer<i64_3> &pos_buf);
269 template void TreeMortonCodes<u32>::build<i64_3>(
270 sham::DeviceScheduler_ptr dev_sched,
275 template std::unique_ptr<sycl::buffer<u32>> TreeMortonCodes<u32>::build_raw<i64_3>(
279 sycl::buffer<i64_3> &pos_buf);
282 template void TreeMortonCodes<u32>::build<u32_3>(
286 sycl::buffer<u32_3> &pos_buf);
288 template void TreeMortonCodes<u32>::build<u32_3>(
289 sham::DeviceScheduler_ptr dev_sched,
294 template std::unique_ptr<sycl::buffer<u32>> TreeMortonCodes<u32>::build_raw<u32_3>(
298 sycl::buffer<u32_3> &pos_buf);
Utility to build morton codes for the radix tree.
std::uint32_t u32
32 bit unsigned integer
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)
Element-wise equality comparison algorithms for buffers.
namespace for primitive algorithm (e.g. sort, scan, reductions, ...)
bool equals(sycl::queue &q, sycl::buffer< T > &buf1, sycl::buffer< T > &buf2, u32 cnt)
Compare elements between two sycl::buffers for equality.