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 static const std::array<std::string,
41 template <std::
size_t buffer_size>
class Probes
44 template <
typename Space>
46 = Kokkos::View<double[buffer_size], Kokkos::LayoutRight, Space>;
52 if constexpr (AutoGenerated::FlagCompileTime::use_probe)
56 Kokkos::deep_copy(
buffer, 0.);
62 template <
typename Space>
63 [[nodiscard]] KOKKOS_INLINE_FUNCTION
bool
66 static_assert(Kokkos::SpaceAccessibility<
68 Kokkos::DefaultExecutionSpace::memory_space>::accessible);
71 if constexpr (AutoGenerated::FlagCompileTime::use_probe)
74 (i < buffer_size) &&
active)
88 if constexpr (AutoGenerated::FlagCompileTime::use_probe)
95 [[nodiscard]] std::span<const double>
98 if constexpr (AutoGenerated::FlagCompileTime::use_probe)
110 assert(return_size <= buffer_size);
124 if constexpr (AutoGenerated::FlagCompileTime::use_probe)
152 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:42
Kokkos::View< uint64_t, Kokkos::SharedSpace > internal_counter
Definition probe.hpp:144
KOKKOS_INLINE_FUNCTION bool set(double val) const
Definition probe.hpp:63
Probes()
Definition probe.hpp:121
buffer_type< Kokkos::DefaultHostExecutionSpace > host_buffer
Definition probe.hpp:145
bool need_export() const noexcept
Definition probe.hpp:85
std::span< const double > get() const
Definition probe.hpp:95
buffer_type< Kokkos::DefaultExecutionSpace > buffer
Definition probe.hpp:143
Kokkos::View< double[buffer_size], Kokkos::LayoutRight, Space > buffer_type
Definition probe.hpp:45
bool active
Definition probe.hpp:141
void clear() const
Definition probe.hpp:49
Namespace that contains classes and structures related to simulation handling.
Definition host_specific.hpp:12
static const std::array< std::string, static_cast< std::size_t >(ProbeType::__COUNT__)> map_probe_name
Definition probe.hpp:24
MapProbes::const_iterator ProbeIterator
Definition probe.hpp:154
ProbeType
Definition probe.hpp:15
@ LeavingTime
Definition probe.hpp:16
@ DivisionTime
Definition probe.hpp:17
@ __COUNT__
Definition probe.hpp:18
Probes< AutoGenerated::probe_buffer_size > ProbeAutogeneratedBuffer
Definition probe.hpp:150
std::unordered_map< ProbeType, ProbeAutogeneratedBuffer > MapProbes
Definition probe.hpp:152