Skip to content

Commit b544de8

Browse files
committed
Clarified error message by including configuration resulting in an error
1 parent de79635 commit b544de8

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

kernel_tuner/runners/simulation.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
from kernel_tuner import util
77

88
_SimulationDevice = namedtuple("_SimulationDevice", ["max_threads", "env", "quiet"])
9+
10+
911
class SimulationDevice(_SimulationDevice):
1012
""" Simulated device used by simulation runner """
1113

@@ -118,7 +120,9 @@ def run(self, parameter_space, kernel_options, tuning_options):
118120
tuning_options.simulated_time += simulated_time
119121
except KeyError:
120122
if "time_limit" in tuning_options:
121-
raise RuntimeError("Cannot use simulation mode with a time limit on a cache file that does not have full compile, verification, and benchmark timings on all configurations")
123+
raise RuntimeError(
124+
"Cannot use simulation mode with a time limit on a cache file that does not have full compile, verification, and benchmark timings on all configurations"
125+
)
122126

123127
total_time = 1000 * (perf_counter() - self.start_time)
124128
self.start_time = perf_counter()
@@ -128,8 +132,7 @@ def run(self, parameter_space, kernel_options, tuning_options):
128132
continue
129133

130134
# if the element is not in the cache, raise an error
131-
logging.debug('kernel configuration not in cache')
132-
print(element)
133-
raise ValueError("Kernel configuration not in cache - in simulation mode, all configurations must be present in the cache")
135+
logging.debug(f"kernel configuration {element} not in cache")
136+
raise ValueError(f"Kernel configuration {element} not in cache - in simulation mode, all configurations must be present in the cache")
134137

135138
return results, self.get_environment(tuning_options)

0 commit comments

Comments
 (0)