diff --git a/examples/cuda/vector_add_observers_pmt.py b/examples/cuda/vector_add_observers_pmt.py index bd8b2d4ea..331be8603 100755 --- a/examples/cuda/vector_add_observers_pmt.py +++ b/examples/cuda/vector_add_observers_pmt.py @@ -31,10 +31,10 @@ def tune(): tune_params = dict() tune_params["block_size_x"] = [128+64*i for i in range(15)] - pmtobserver = PMTObserver(["nvidia", "rapl"]) + pmtobserver = PMTObserver(["nvml", "rapl"]) metrics = OrderedDict() - metrics["GPU W"] = lambda p: p["nvidia_power"] + metrics["GPU W"] = lambda p: p["nvml_power"] metrics["CPU W"] = lambda p: p["rapl_power"] results, env = tune_kernel("vector_add", kernel_string, size, args, tune_params, observers=[pmtobserver], metrics=metrics, iterations=32) diff --git a/kernel_tuner/observers/pmt.py b/kernel_tuner/observers/pmt.py index aa0d31810..6efb1209a 100644 --- a/kernel_tuner/observers/pmt.py +++ b/kernel_tuner/observers/pmt.py @@ -43,12 +43,11 @@ def __init__(self, observable=None): else: # User specifices a string (single platform) as observable observable = {observable: None} - supported = ["powersensor2", "powersensor3", "nvidia", "likwid", "rapl", "rocm", "xilinx"] + supported = ["arduino", "jetson", "likwid", "nvml", "rapl", "rocm", "xilinx"] for obs in observable.keys(): if not obs in supported: raise ValueError(f"Observable {obs} not in supported: {supported}") - print(observable.items()) self.pms = [pmt.get_pmt(obs[0], obs[1]) for obs in observable.items()] self.pm_names = list(observable.keys()) @@ -71,9 +70,8 @@ def after_finish(self): for i in range(len(self.pms)): begin_state = self.begin_states[i] end_state = end_states[i] - measured_energy = pmt.pypmt.PMT.joules(begin_state, end_state) - measured_power = pmt.pypmt.PMT.watts(begin_state, end_state) - print(measured_energy, measured_power) + measured_energy = pmt.joules(begin_state, end_state) + measured_power = pmt.watts(begin_state, end_state) pm_name = self.pm_names[i] energy_result_name = f"{pm_name}_energy" power_result_name = f"{pm_name}_power"