26 using Tscal = shambase::VecComponent<Tvec>;
28 auto edges = get_edges();
30 edges.spans_coordinates.check_sizes(edges.sizes.indexes);
31 edges.spans_a_ext.check_sizes(edges.sizes.indexes);
33 auto &coordinates_spans = edges.spans_coordinates.get_spans();
34 auto &a_ext_spans = edges.spans_a_ext.get_spans();
36 const Tscal gmass = mass * edges.constant_G.value;
39 = edges.sizes.indexes.template map<u32>([&](
u64 id,
u32 block_count) {
40 u32 cell_count = block_count * block_size;
44 static constexpr u32 dim = shambase::VectorProperties<Tvec>::dimension;
47 shamsys::instance::get_compute_scheduler_ptr(),
51 [pos = pos, gmass = gmass, epsilon_soft = epsilon_soft](
52 u32 i,
const Tvec *__restrict cell_coor, Tvec *__restrict a_ext) {
53 Tvec cell_pos = cell_coor[i];
56 Tvec r_vec = cell_pos - pos;
59 Tscal r_squared = sycl::dot(r_vec, r_vec);
61 Tscal inv_r_soft = sycl::rsqrt(r_squared + epsilon_soft * epsilon_soft);
62 Tscal one_over_r_cube_soft = inv_r_soft * inv_r_soft * inv_r_soft;
65 a_ext[i] -= gmass * r_vec * one_over_r_cube_soft;
void distributed_data_kernel_call(sham::DeviceScheduler_ptr dev_sched, RefIn in, RefOut in_out, const shambase::DistributedData< index_t > &thread_counts, Functor &&func)
A variant of sham::kernel_call for distributed data.