Skip to content

Commit 81ad294

Browse files
committed
energy-profiler: fix for new infrastructure
1 parent 7cdd9ea commit 81ad294

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

profiling/energy-profiler/kokkos-tools/kp_variorum_power.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ using namespace KokkosTools::EnergyProfiler;
4949
namespace KokkosTools {
5050
namespace VariorumPower {
5151

52-
Timer::KernelTimerTool timer;
52+
EnergyProfiler::KernelTimerTool timer;
5353

5454
// --- Data Structures for Self-Contained Management ---
5555

@@ -205,16 +205,16 @@ void kokkosp_finalize_library() {
205205
std::string prefix = generate_prefix();
206206

207207
const auto& kernels = timer.get_kernel_timings();
208-
KokkosTools::Timer::print_kernels_summary(kernels);
209-
KokkosTools::Timer::export_kernels_csv(kernels, prefix + "_kernels.csv");
208+
KokkosTools::EnergyProfiler::print_kernels_summary(kernels);
209+
KokkosTools::EnergyProfiler::export_kernels_csv(kernels, prefix + "_kernels.csv");
210210

211211
const auto& regions = timer.get_region_timings();
212-
KokkosTools::Timer::print_regions_summary(regions);
213-
KokkosTools::Timer::export_regions_csv(regions, prefix + "_regions.csv");
212+
KokkosTools::EnergyProfiler::print_regions_summary(regions);
213+
KokkosTools::EnergyProfiler::export_regions_csv(regions, prefix + "_regions.csv");
214214

215215
const auto& deepcopies = timer.get_deep_copy_timings();
216-
KokkosTools::Timer::print_deepcopies_summary(deepcopies);
217-
KokkosTools::Timer::export_deepcopies_csv(deepcopies,
216+
KokkosTools::EnergyProfiler::print_deepcopies_summary(deepcopies);
217+
KokkosTools::EnergyProfiler::export_deepcopies_csv(deepcopies,
218218
prefix + "_deepcopies.csv");
219219
}
220220

profiling/energy-profiler/provider/provider_variorum.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Result VariorumProvider::initialize() {
2828
}
2929

3030
is_initialized_ = true;
31-
ENERGY_PROFILER_LOG_INFO(
31+
KOKKOS_TOOLS_ENERGY_PROFILER_LOG_INFO(
3232
COMPONENT_NAME, "Successfully initialized with " +
3333
std::to_string(device_ids_.size()) + " device(s)");
3434

@@ -43,7 +43,7 @@ void VariorumProvider::finalize() {
4343
cleanup_devices();
4444
is_initialized_ = false;
4545

46-
ENERGY_PROFILER_LOG_INFO(COMPONENT_NAME, "Finalized");
46+
KOKKOS_TOOLS_ENERGY_PROFILER_LOG_INFO(COMPONENT_NAME, "Finalized");
4747
}
4848

4949
Result VariorumProvider::get_total_power_usage(double& power_watts) {
@@ -123,7 +123,7 @@ Result VariorumProvider::discover_devices() {
123123
uint32_t device_id = std::stoul(s_key.substr(4));
124124
found_device_ids.insert(device_id);
125125
} catch (const std::exception& e) {
126-
ENERGY_PROFILER_LOG_WARNING(
126+
KOKKOS_TOOLS_ENERGY_PROFILER_LOG_WARNING(
127127
COMPONENT_NAME, "Could not parse GPU ID from key: " + s_key +
128128
" (" + e.what() + ")");
129129
}
@@ -144,25 +144,25 @@ Result VariorumProvider::discover_devices() {
144144
device_ids_.push_back(device_id);
145145
device_names_.push_back("GPU_" + std::to_string(device_id));
146146

147-
ENERGY_PROFILER_LOG_INFO(
147+
KOKKOS_TOOLS_ENERGY_PROFILER_LOG_INFO(
148148
COMPONENT_NAME, "Found device " +
149149
std::to_string(device_ids_.size() - 1) + ": GPU_" +
150150
std::to_string(device_id));
151151
}
152152

153153
// Test initial power readings
154-
ENERGY_PROFILER_LOG_INFO(COMPONENT_NAME, "Testing initial power readings...");
154+
KOKKOS_TOOLS_ENERGY_PROFILER_LOG_INFO(COMPONENT_NAME, "Testing initial power readings...");
155155
std::map<uint32_t, double> test_readings = get_current_power_readings();
156156
for (size_t i = 0; i < device_ids_.size(); ++i) {
157157
uint32_t device_id = device_ids_[i];
158158
auto it = test_readings.find(device_id);
159159
if (it != test_readings.end()) {
160-
ENERGY_PROFILER_LOG_INFO(
160+
KOKKOS_TOOLS_ENERGY_PROFILER_LOG_INFO(
161161
COMPONENT_NAME,
162162
"Device " + std::to_string(i) +
163163
": Current power usage: " + std::to_string(it->second) + " W");
164164
} else {
165-
ENERGY_PROFILER_LOG_WARNING(
165+
KOKKOS_TOOLS_ENERGY_PROFILER_LOG_WARNING(
166166
COMPONENT_NAME,
167167
"Device " + std::to_string(i) + ": Power reading failed");
168168
}

0 commit comments

Comments
 (0)