@@ -71,15 +71,8 @@ def run(self, parameter_space, kernel_options, tuning_options):
7171 for element in parameter_space :
7272 params = OrderedDict (zip (tuning_options .tune_params .keys (), element ))
7373
74- # attempt to warmup the GPU by running the first config in the parameter space and ignoring the result
75- warmup_time = 0
76- if not self .warmed_up :
77- warmup_time = perf_counter ()
78- self .dev .compile_and_benchmark (self .kernel_source , self .gpu_args , params , kernel_options , tuning_options )
79- self .warmed_up = True
80- warmup_time = 1e3 * (perf_counter () - warmup_time )
81-
8274 result = None
75+ warmup_time = 0
8376
8477 # check if configuration is in the cache
8578 x_int = "," .join ([str (i ) for i in element ])
@@ -89,6 +82,14 @@ def run(self, parameter_space, kernel_options, tuning_options):
8982 params ['verification_time' ] = 0
9083 params ['benchmark_time' ] = 0
9184 else :
85+
86+ # attempt to warmup the GPU by running the first config in the parameter space and ignoring the result
87+ if not self .warmed_up :
88+ warmup_time = perf_counter ()
89+ self .dev .compile_and_benchmark (self .kernel_source , self .gpu_args , params , kernel_options , tuning_options )
90+ self .warmed_up = True
91+ warmup_time = 1e3 * (perf_counter () - warmup_time )
92+
9293 result = self .dev .compile_and_benchmark (self .kernel_source , self .gpu_args , params , kernel_options , tuning_options )
9394
9495 params .update (result )
0 commit comments