Skip to content

Commit 856cc0f

Browse files
bugfix in example, issue #192
1 parent ea3d4fc commit 856cc0f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

examples/cuda/expdist.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import numpy
55

66
from kernel_tuner import tune_kernel
7+
from kernel_tuner import util
78

89
def tune_expdist():
910

@@ -43,7 +44,7 @@ def tune_expdist():
4344
json.dump(kernel1, fp)
4445

4546
#get the number of blocks used by the best configuration in the first kernel
46-
best_config1 = min(kernel1[0], key=lambda x:x['time'])
47+
best_config1 = util.get_best_config(kernel1[0], 'time')
4748
nblocks = numpy.int32( numpy.ceil(size / float(best_config1["block_size_x"]*best_config1["tile_size_x"])) *
4849
numpy.ceil(size / float(best_config1["block_size_y"]*best_config1["tile_size_y"])) )
4950

@@ -56,7 +57,7 @@ def tune_expdist():
5657
kernel2 = tune_kernel("reduce_cross_term", kernel_string, 1, arguments, tune_params,
5758
grid_div_x=[], verbose=True)
5859

59-
best_config2 = min(kernel2[0], key=lambda x:x['time'])
60+
best_config2 = util.get_best_config(kernel2[0], 'time')
6061
print("best GPU configuration, total time=", best_config1['time'] + best_config2['time'])
6162
print(best_config1)
6263
print(best_config2)

0 commit comments

Comments
 (0)