Skip to content

Commit db9fc45

Browse files
committed
Properly handle arguments for PMTObserver
1 parent e21681a commit db9fc45

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

examples/cuda/vector_add_observers_pmt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def tune():
3131
tune_params = dict()
3232
tune_params["block_size_x"] = [128+64*i for i in range(15)]
3333

34-
pmtobserver = PMTObserver(["nvidia", "rapl"])
34+
pmtobserver = PMTObserver([("nvidia", 0), "rapl"])
3535

3636
metrics = OrderedDict()
3737
metrics["GPU W"] = lambda p: p["nvidia_power"]

kernel_tuner/observers/pmt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ def __init__(self, observable=None):
3838
if type(observable) is dict:
3939
pass
4040
elif type(observable) is list:
41-
# user specifies a list of platforms as observable
42-
observable = dict([(obs, 0) for obs in observable])
41+
# user specifies a list of platforms as observable, optionally with an argument
42+
observable = dict([obs if isinstance(obs, tuple) else (obs, None) for obs in observable])
4343
else:
4444
# User specifices a string (single platform) as observable
4545
observable = {observable: None}

0 commit comments

Comments
 (0)