32 auto edges = get_edges();
34 auto dev_sched = shamsys::instance::get_compute_scheduler_ptr();
40 edges.part_counts.indexes.for_each([&](
u64 id_patch,
u32 Nobj) {
41 auto &pdat = edges.pdats.get(id_patch);
42 auto &acc_table = edges.sink_accretion_table.get_spans().get(id_patch);
53 const u32 *__restrict acc_table,
54 u32 *__restrict keep_flag,
55 int *__restrict accr_flag) {
56 bool keep = acc_table[id_a] ==
u32_max;
57 keep_flag[id_a] = keep ? 1 : 0;
61 sycl::memory_order_relaxed,
62 sycl::memory_scope_device,
63 sycl::access::address_space::global_space>
64 atomic_accr(accr_flag[0]);
67 atomic_accr.fetch_or(1);
73 if (accr_flag_val != 0) {
79 id_list_keep, shambase::narrow_or_throw<u32>(id_list_keep.
get_size()));
Header file describing a Node Instance.
Remove SPH particles flagged for sink accretion from patch data.
std::uint32_t u32
32 bit unsigned integer
std::uint64_t u64
64 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.
void fill(T value, std::array< size_t, 2 > idx_range)
Fill a subpart of the buffer with a given value.
T get_val_at_idx(size_t idx) const
Get the value at a given index in the buffer.
size_t get_size() const
Gets the number of elements in the buffer.
void _impl_evaluate_internal()
evaluate the node
virtual std::string _impl_get_tex() const
get the tex of the node
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.
std::tuple< std::optional< sycl::buffer< u32 > >, u32 > stream_compact(sycl::queue &q, sycl::buffer< u32 > &buf_flags, u32 len)
Stream compaction algorithm.
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...
namespace for the sph model modules
Utilities for safe type narrowing conversions.
constexpr u32 u32_max
u32 max value
#define __shamrock_stack_entry()
Macro to create a stack entry.
A class that references multiple buffers or similar objects.