45 #ifndef KOKKOSP_PROFILE_SECTION_HPP 46 #define KOKKOSP_PROFILE_SECTION_HPP 48 #include <Kokkos_Macros.hpp> 49 #include <impl/Kokkos_Profiling_Interface.hpp> 50 #include <impl/Kokkos_Profiling.hpp> 57 class ProfilingSection {
59 ProfilingSection(
const std::string& sectionName) : secName(sectionName) {
60 if (Kokkos::Profiling::profileLibraryLoaded()) {
61 Kokkos::Profiling::createProfileSection(secName, &secID);
66 if (Kokkos::Profiling::profileLibraryLoaded()) {
67 Kokkos::Profiling::startSection(secID);
72 if (Kokkos::Profiling::profileLibraryLoaded()) {
73 Kokkos::Profiling::stopSection(secID);
78 if (Kokkos::Profiling::profileLibraryLoaded()) {
79 Kokkos::Profiling::destroyProfileSection(secID);
83 std::string getName() {
return secName; }
85 uint32_t getSectionID() {
return secID; }
88 const std::string secName;