diff --git a/examples/cuda/vector_add_observers_pmt.py b/examples/cuda/vector_add_observers_pmt.py index bd8b2d4e..1f6e491d 100755 --- a/examples/cuda/vector_add_observers_pmt.py +++ b/examples/cuda/vector_add_observers_pmt.py @@ -31,7 +31,7 @@ def tune(): tune_params = dict() tune_params["block_size_x"] = [128+64*i for i in range(15)] - pmtobserver = PMTObserver(["nvidia", "rapl"]) + pmtobserver = PMTObserver([("nvidia", 0), "rapl"]) metrics = OrderedDict() metrics["GPU W"] = lambda p: p["nvidia_power"] diff --git a/kernel_tuner/observers/pmt.py b/kernel_tuner/observers/pmt.py index 21d777fb..bb1d76bd 100644 --- a/kernel_tuner/observers/pmt.py +++ b/kernel_tuner/observers/pmt.py @@ -38,8 +38,8 @@ def __init__(self, observable=None): if type(observable) is dict: pass elif type(observable) is list: - # user specifies a list of platforms as observable - observable = dict([(obs, 0) for obs in observable]) + # user specifies a list of platforms as observable, optionally with an argument + observable = dict([obs if isinstance(obs, tuple) else (obs, None) for obs in observable]) else: # User specifices a string (single platform) as observable observable = {observable: None}