Skip to content

Commit

Permalink
Cosmetic changes to ProfilingSection
Browse files Browse the repository at this point in the history
  • Loading branch information
dalg24 committed Jan 3, 2024
1 parent f485cfa commit 4eae6a9
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions core/src/Kokkos_Profiling_ProfileSection.hpp
Expand Up @@ -26,10 +26,11 @@

#include <string>

namespace Kokkos {
namespace Profiling {
namespace Kokkos::Profiling {

class [[nodiscard]] ProfilingSection {
uint32_t sectionID;

public:
ProfilingSection(ProfilingSection const&) = delete;
ProfilingSection& operator=(ProfilingSection const&) = delete;
Expand All @@ -38,21 +39,17 @@ class [[nodiscard]] ProfilingSection {
[[nodiscard]]
#endif
explicit ProfilingSection(const std::string& sectionName) {
Kokkos::Profiling::createProfileSection(sectionName, &secID);
Kokkos::Profiling::createProfileSection(sectionName, &sectionID);
}

void start() { Kokkos::Profiling::startSection(secID); }

void stop() { Kokkos::Profiling::stopSection(secID); }
void start() { Kokkos::Profiling::startSection(sectionID); }

~ProfilingSection() { Kokkos::Profiling::destroyProfileSection(secID); }
void stop() { Kokkos::Profiling::stopSection(sectionID); }

protected:
uint32_t secID;
~ProfilingSection() { Kokkos::Profiling::destroyProfileSection(sectionID); }
};

} // namespace Profiling
} // namespace Kokkos
} // namespace Kokkos::Profiling

#ifdef KOKKOS_IMPL_PUBLIC_INCLUDE_NOTDEFINED_CORE
#undef KOKKOS_IMPL_PUBLIC_INCLUDE
Expand Down

0 comments on commit 4eae6a9

Please sign in to comment.