45 #ifndef KOKKOSP_PROFILE_SECTION_HPP
46 #define KOKKOSP_PROFILE_SECTION_HPP
48 #include <Kokkos_Macros.hpp>
49 #include <impl/Kokkos_Profiling_Interface.hpp>
56 class ProfilingSection {
58 ProfilingSection(
const std::string& sectionName) : secName(sectionName) {
59 #if defined(KOKKOS_ENABLE_PROFILING)
60 if (Kokkos::Profiling::profileLibraryLoaded()) {
61 Kokkos::Profiling::createProfileSection(secName, &secID);
69 #if defined(KOKKOS_ENABLE_PROFILING)
70 if (Kokkos::Profiling::profileLibraryLoaded()) {
71 Kokkos::Profiling::startSection(secID);
77 #if defined(KOKKOS_ENABLE_PROFILING)
78 if (Kokkos::Profiling::profileLibraryLoaded()) {
79 Kokkos::Profiling::stopSection(secID);
85 #if defined(KOKKOS_ENABLE_PROFILING)
86 if (Kokkos::Profiling::profileLibraryLoaded()) {
87 Kokkos::Profiling::destroyProfileSection(secID);
92 std::string getName() {
return secName; }
94 uint32_t getSectionID() {
return secID; }
97 const std::string secName;