31 auto edges = get_edges();
33 edges.spans_block_cell_sizes.check_sizes(edges.sizes.indexes);
34 edges.spans_in.check_sizes(edges.sizes.indexes);
35 edges.spans_out.ensure_sizes(edges.sizes.indexes);
37 auto &q = shamsys::instance::get_compute_scheduler().get_queue();
39 edges.cell_neigh_graph.graph.for_each(
41 auto &cell_sizes_span = edges.spans_block_cell_sizes.get_spans().get(
id);
42 auto &in_span = edges.spans_in.get_spans().get(
id);
43 auto &out_span = edges.spans_out.get_spans().get(
id);
45 auto get_graph = [&](Direction dir) ->
const AMRGraph & {
49 const AMRGraph &graph_neigh_xp = get_graph(Direction::xp);
50 const AMRGraph &graph_neigh_xm = get_graph(Direction::xm);
51 const AMRGraph &graph_neigh_yp = get_graph(Direction::yp);
52 const AMRGraph &graph_neigh_ym = get_graph(Direction::ym);
53 const AMRGraph &graph_neigh_zp = get_graph(Direction::zp);
54 const AMRGraph &graph_neigh_zm = get_graph(Direction::zm);
56 u32 cell_count = edges.sizes.indexes.get(
id) * block_size;
71 [block_size = block_size](
73 const Tscal *__restrict cell_sizes,
74 const Tscal *__restrict in,
81 Tscal *__restrict out) {
93 return sycl::isnan(in[
id]) ? Tscal{0} : in[id];
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.
T & get_check_ref(const std::unique_ptr< T > &ptr, SourceLocation loc=SourceLocation())
Takes a std::unique_ptr and returns a reference to the object it holds. It throws a std::runtime_erro...
T laplacian_7pt(const shambase::VecComponent< Tvec > *cell_sizes, const u32 block_size, const u32 cell_global_id, const AMRGraphLinkiterator &graph_iter_xp, const AMRGraphLinkiterator &graph_iter_xm, const AMRGraphLinkiterator &graph_iter_yp, const AMRGraphLinkiterator &graph_iter_ym, const AMRGraphLinkiterator &graph_iter_zp, const AMRGraphLinkiterator &graph_iter_zm, ACCField &&field_access)
Get the discretized (finite volume) Laplacian.