1#ifndef __SIMULATION_KERNELS_HPP__
2#define __SIMULATION_KERNELS_HPP__
4#include "Kokkos_Printf.hpp"
5#include "common/common.hpp"
6#include <common/kokkos_getpolicy.hpp>
8#include <simulation/kernels/model_kernel.hpp>
9#include <simulation/kernels/move_kernel.hpp>
12 template <
typename Space>
15 template <
typename Space>
70 Kokkos::create_mirror_view_and_copy(HostSpace(),
cycle_reducer)();
72 const auto host_out_counter =
73 Kokkos::create_mirror_view_and_copy(HostSpace(),
move_reducer)();
75 return std::tuple(host_red, host_out_counter);
88 std::move(_concentrations),
110 const auto _policy_move =
113 Kokkos ::parallel_for(
"cycle_move", _policy_move,
move_kernel);
125 const auto _policy_leave =
126 Kokkos::RangePolicy<KernelInline::TagLeave>(0, n_particle);
128 Kokkos ::parallel_reduce(
135 constexpr bool is_reduce =
true;
162 auto _policy = Kokkos::RangePolicy<TagCycle>(0, n_particle);
163 Kokkos::parallel_reduce(
Main owning object for Monte-Carlo particles.
Definition particles_container.hpp:53
void change_nsample(const std::size_t new_n_sample)
Definition particles_container.hpp:172
KOKKOS_INLINE_FUNCTION std::size_t n_particles() const
Gets the number of particles in the container.
Definition particles_container.hpp:464
ParticleSamples random
Definition particles_container.hpp:84
MC::ParticlePositions position
Definition particles_container.hpp:80
ParticleAges ages
Definition particles_container.hpp:83
MC::ParticleStatus status
Definition particles_container.hpp:81
Definition model_kernel.hpp:43
Kokkos::View< value_type, Space > result_view_type
Definition model_kernel.hpp:48
Kokkos::TeamPolicy< ComputeSpace, Tag > get_policy(const FunctorType &f, std::size_t range, bool reduce=false)
Definition kokkos_getpolicy.hpp:37
gen_pool_type< Kokkos::DefaultExecutionSpace > pool_type
Definition alias.hpp:38
decltype(Kokkos::Experimental::create_scatter_view(kernelContribution())) ContributionView
Definition alias.hpp:87
Kokkos::View< const double **, Kokkos::LayoutLeft, ComputeSpace, Kokkos::MemoryTraits< Kokkos::RandomAccess > > KernelConcentrationType
Definition alias.hpp:90
Definition kernels.hpp:11
constexpr bool enable_leave
Definition move_kernel.hpp:26
constexpr bool enable_move
Definition move_kernel.hpp:29
KernelInline::CycleReducer< Space >::result_view_type cycle_reducer_view_type
Definition kernels.hpp:13
Kokkos::View< std::size_t, Space > move_reducer_view_type
Definition kernels.hpp:16
Probes< AutoGenerated::probe_buffer_size > ProbeAutogeneratedBuffer
Definition probe.hpp:61
Use to count events that occurs during Monte-Carlo processing cycles.
Definition events.hpp:44
Definition model_kernel.hpp:106
CycleFunctor< Model > cycle_kernel_type
Definition kernels.hpp:22
void update(double d_t, MC::ParticlesContainer< Model > container, MoveInfo< ComputeSpace > new_move)
Definition kernels.hpp:34
cycle_kernel_type cycle_kernel
Definition kernels.hpp:29
MoveFunctor move_kernel_type
Definition kernels.hpp:23
CycleFunctors(MC::ParticlesContainer< Model > container, MC::pool_type _random_pool, MC::KernelConcentrationType &&_concentrations, MC::ContributionView _contribs_scatter, MC::EventContainer _event, MoveInfo< ComputeSpace > m, ProbeAutogeneratedBuffer _probes)
Definition kernels.hpp:78
move_kernel_type move_kernel
Definition kernels.hpp:30
auto get_host_reduction()
Definition kernels.hpp:67
void launch_move(const std::size_t n_particle) const
Definition kernels.hpp:102
ComputeSpace move_space
Definition kernels.hpp:25
cycle_reducer_view_type< Space > cycle_reducer
Definition kernels.hpp:27
move_reducer_view_type< Space > move_reducer
Definition kernels.hpp:28
void launch_model(const std::size_t n_particle) const
Definition kernels.hpp:133
Model FModel
Definition kernels.hpp:20
Definition move_kernel.hpp:133
Definition move_info.hpp:19
Kokkos::View< LeavingFlow *, Kokkos::SharedHostPinnedSpace, Kokkos::MemoryTraits< Kokkos::MemoryTraitsFlags::Aligned|Kokkos::MemoryTraitsFlags::Restrict > > leaving_flow
Definition move_info.hpp:29
Kokkos::View< double *, ExecSpace > liquid_volume
Definition move_info.hpp:30