17#ifndef KOKKOSP_PROFILE_SECTION_HPP
18#define KOKKOSP_PROFILE_SECTION_HPP
19#ifndef KOKKOS_IMPL_PUBLIC_INCLUDE
20#define KOKKOS_IMPL_PUBLIC_INCLUDE
21#define KOKKOS_IMPL_PUBLIC_INCLUDE_PROFILING_PROFILESECTION
24#include <Kokkos_Macros.hpp>
25#include <impl/Kokkos_Profiling_Interface.hpp>
26#include <impl/Kokkos_Profiling.hpp>
33class ProfilingSection {
35 ProfilingSection(ProfilingSection
const&) =
delete;
36 ProfilingSection& operator=(ProfilingSection
const&) =
delete;
38 ProfilingSection(
const std::string& sectionName) {
39 if (Kokkos::Profiling::profileLibraryLoaded()) {
40 Kokkos::Profiling::createProfileSection(sectionName, &secID);
45 if (Kokkos::Profiling::profileLibraryLoaded()) {
46 Kokkos::Profiling::startSection(secID);
51 if (Kokkos::Profiling::profileLibraryLoaded()) {
52 Kokkos::Profiling::stopSection(secID);
57 if (Kokkos::Profiling::profileLibraryLoaded()) {
58 Kokkos::Profiling::destroyProfileSection(secID);
69#ifdef KOKKOS_IMPL_PUBLIC_INCLUDE_NOTDEFINED_CORE
70#undef KOKKOS_IMPL_PUBLIC_INCLUDE
71#undef KOKKOS_IMPL_PUBLIC_INCLUDE_NOTDEFINED_PROFILING_PROFILESECTION