1#ifndef __CORE__PROBE_HPP__
2#define __CORE__PROBE_HPP__
4#include <Kokkos_Core.hpp>
5#include <biocma_cst_config.hpp>
9#include <unordered_map>
22 = {
"LeavingTime",
"DivisionTime" };
39 template <std::
size_t buffer_size>
class Probes
42 template <
typename Space>
44 = Kokkos::View<double[buffer_size], Kokkos::LayoutRight, Space>;
50 if constexpr (AutoGenerated::FlagCompileTime::use_probe)
54 Kokkos::deep_copy(
buffer, 0.);
60 template <
typename Space>
61 [[nodiscard]] KOKKOS_INLINE_FUNCTION
bool
64 static_assert(Kokkos::SpaceAccessibility<
66 Kokkos::DefaultExecutionSpace::memory_space>::accessible);
69 if constexpr (AutoGenerated::FlagCompileTime::use_probe)
72 (i < buffer_size) &&
active)
86 if constexpr (AutoGenerated::FlagCompileTime::use_probe)
93 [[nodiscard]] std::span<const double>
96 if constexpr (AutoGenerated::FlagCompileTime::use_probe)
108 assert(return_size <= buffer_size);
122 if constexpr (AutoGenerated::FlagCompileTime::use_probe)
146 using MapProbes = std::unordered_map<ProbeType, ProbeAutogeneratedBuffer>;
Class to store time event as bulk storage !! The behaviour of this class is directly link to value of...
Definition probe.hpp:40
Kokkos::View< uint64_t, Kokkos::SharedSpace > internal_counter
Definition probe.hpp:138
KOKKOS_INLINE_FUNCTION bool set(double val) const
Definition probe.hpp:61
Probes()
Definition probe.hpp:119
buffer_type< Kokkos::DefaultHostExecutionSpace > host_buffer
Definition probe.hpp:139
bool need_export() const noexcept
Definition probe.hpp:83
std::span< const double > get() const
Definition probe.hpp:93
buffer_type< Kokkos::DefaultExecutionSpace > buffer
Definition probe.hpp:137
Kokkos::View< double[buffer_size], Kokkos::LayoutRight, Space > buffer_type
Definition probe.hpp:43
bool active
Definition probe.hpp:135
void clear() const
Definition probe.hpp:47
Namespace that contains classes and structures related to simulation handling.
Definition host_specific.hpp:12
MapProbes::const_iterator ProbeIterator
Definition probe.hpp:148
ProbeType
Definition probe.hpp:15
@ LeavingTime
Definition probe.hpp:16
@ DivisionTime
Definition probe.hpp:17
Probes< AutoGenerated::probe_buffer_size > ProbeAutogeneratedBuffer
Definition probe.hpp:144
static const std::array< std::string, 2 > map_probe_name
Definition probe.hpp:22
std::unordered_map< ProbeType, ProbeAutogeneratedBuffer > MapProbes
Definition probe.hpp:146