Skip to content

Commit 1548879

Browse files
bugfix runner for custom objectives
1 parent 653f617 commit 1548879

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

kernel_tuner/runners/sequential.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def run(self, parameter_space, kernel_options, tuning_options):
9696
params.update(result)
9797

9898
# only compute metrics on configs that have not errored
99-
if isinstance(result[tuning_options.objective], ErrorConfig):
99+
if tuning_options.objective in result and isinstance(result[tuning_options.objective], ErrorConfig):
100100
logging.debug('kernel configuration was skipped silently due to compile or runtime failure')
101101
elif tuning_options.metrics:
102102
params = process_metrics(params, tuning_options.metrics)

test/test_runners.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,8 @@ def test_runner(env):
261261
platform = 0
262262
iterations = 7
263263
verbose = False
264-
objective = "time"
264+
objective = "GFLOP/s"
265+
metrics = OrderedDict({objective: lambda p: 1})
265266
opts = locals()
266267
kernel_options = Options([(k, opts.get(k, None))
267268
for k in _kernel_options.keys()])

0 commit comments

Comments
 (0)