Skip to content

Commit

Permalink
Drop unnecessary guarding for a tool library being loaded in Profilin…
Browse files Browse the repository at this point in the history
…gSection
  • Loading branch information
dalg24 committed Jan 2, 2024
1 parent fe06b6f commit 5aa0cee
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions core/src/Kokkos_Profiling_ProfileSection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,28 +36,14 @@ class ProfilingSection {
ProfilingSection& operator=(ProfilingSection const&) = delete;

ProfilingSection(const std::string& sectionName) {
if (Kokkos::Profiling::profileLibraryLoaded()) {
Kokkos::Profiling::createProfileSection(sectionName, &secID);
}
Kokkos::Profiling::createProfileSection(sectionName, &secID);
}

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

void stop() {
if (Kokkos::Profiling::profileLibraryLoaded()) {
Kokkos::Profiling::stopSection(secID);
}
}
void stop() { Kokkos::Profiling::stopSection(secID); }

~ProfilingSection() {
if (Kokkos::Profiling::profileLibraryLoaded()) {
Kokkos::Profiling::destroyProfileSection(secID);
}
}
~ProfilingSection() { Kokkos::Profiling::destroyProfileSection(secID); }

protected:
uint32_t secID;
Expand Down

0 comments on commit 5aa0cee

Please sign in to comment.