43 const sham::DeviceScheduler_ptr &dev_sched,
u32 graph_nodes, Args &&...args) {
45 auto &q = dev_sched->get_queue();
47 NeighFindKernel kergen(std::forward<Args>(args)...);
54 if (graph_nodes > 0) {
61 [](
u32 id_a,
const auto ker,
u32 *__restrict ptr_link_cnt) {
62 u32 block_found_count = 0;
64 ker.for_each_other_index(id_a, [&](
u32 id_b) {
68 ptr_link_cnt[id_a] = block_found_count;
73 link_counts.set_val_at_idx(graph_nodes, 0);
82 if (graph_nodes > 0) {
90 const u32 *__restrict cnt_offsets,
92 u32 *__restrict links) {
93 u32 next_link_idx = cnt_offsets[id_a];
95 ker2.for_each_other_index(id_a, [&](
u32 id_b) {
96 links[next_link_idx] = id_b;
105 .node_link_offset = std::move(link_cnt_offsets),
106 .node_links = std::move(ids_links),
107 .link_count = link_cnt,
108 .obj_cnt = graph_nodes});
126 const sham::DeviceScheduler_ptr &dev_sched,
u32 graph_nodes, Args &&...args) {
128 auto &q = dev_sched->get_queue();
137 auto e = q.submit(deps, [&](sycl::handler &cgh) {
138 NeighFindKernel ker(cgh, std::forward<Args>(args)...);
139 shambase::parallel_for(cgh, graph_nodes,
"count block graph link", [=](
u64 gid) {
141 u32 block_found_count = 0;
143 ker.for_each_other_index(id_a, [&](
u32 id_b) {
147 ptr_link_cnt[id_a] = block_found_count;
154 link_counts.set_val_at_idx(graph_nodes, 0);
168 auto e2 = q.submit(deps2, [&](sycl::handler &cgh) {
169 NeighFindKernel ker(cgh, std::forward<Args>(args)...);
170 shambase::parallel_for(cgh, graph_nodes,
"get ids block graph link", [=](
u64 gid) {
173 u32 next_link_idx = cnt_offsets[id_a];
175 ker.for_each_other_index(id_a, [&](
u32 id_b) {
176 links[next_link_idx] = id_b;
188 .node_link_offset = std::move(link_cnt_offsets),
189 .node_links = std::move(ids_links),
190 .link_count = link_cnt,
191 .obj_cnt = graph_nodes});
shammodels::basegodunov::modules::NeighGraph compute_neigh_graph(const sham::DeviceScheduler_ptr &dev_sched, u32 graph_nodes, Args &&...args)
Create a neighbour graph using a class that will list the ids of the found neighbourgh NeighFindKerne...
void kernel_call(sham::DeviceQueue &q, RefIn in, RefOut in_out, u32 n, Functor &&func, SourceLocation &&callsite=SourceLocation{})
Submit a kernel to a SYCL queue.