Skip to content

Commit

Permalink
update observer to latest python bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
benvanwerkhoven committed Nov 19, 2024
1 parent 4c0a877 commit ef39fc9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions kernel_tuner/observers/powersensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
class PowerSensorObserver(BenchmarkObserver):
"""Observer that an external PowerSensor2 device to accurately measure power
Requires PowerSensor2 hardware and powersensor Python bindings.
Requires PowerSensor3 hardware and powersensor Python bindings.
:param observables: A list of string, containing any of "ps_energy" or "ps_power".
To measure energy in Joules or power consumption in Watt.
Expand Down Expand Up @@ -51,9 +51,8 @@ def after_finish(self):
) # Joules
self.results["ps_energy"].append(ps_measured_e)
if "ps_power" in self.observables:
ps_measured_t = (
end_state.time_at_read - self.begin_state.time_at_read
) # seconds
ps_measured_t = ((end_state.time_at_read - self.begin_state.time_at_read).microseconds / 1e6) # Seconds

self.results["ps_power"].append(ps_measured_e / ps_measured_t) # Watt

def get_results(self):
Expand Down

0 comments on commit ef39fc9

Please sign in to comment.