From 267d735ae9ddf453c107e328922991d6a526dbe5 Mon Sep 17 00:00:00 2001 From: milo Date: Mon, 20 Jan 2025 11:18:46 +0000 Subject: [PATCH] fix: NoneType object is not subscriptable for setup_dict and cleanup_dict --- kernel_tuner/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel_tuner/core.py b/kernel_tuner/core.py index 8c1e3772..f07cb353 100644 --- a/kernel_tuner/core.py +++ b/kernel_tuner/core.py @@ -616,7 +616,7 @@ def compile_and_benchmark(self, kernel_source, gpu_args, params, kernel_options, start_benchmark = time.perf_counter() # Run code before benchmarking when using the compiler backend - if "setup_dict" in kernel_options and isinstance(self.dev, CompilerFunctions): + if kernel_options["setup_dict"] and isinstance(self.dev, CompilerFunctions): setup_dict = kernel_options["setup_dict"] args_len = setup_dict["args_len"] kernel_name = kernel_options["kernel_name"] @@ -632,7 +632,7 @@ def compile_and_benchmark(self, kernel_source, gpu_args, params, kernel_options, last_benchmark_time = 1000 * (time.perf_counter() - start_benchmark) # Run code after benchmarking when using the compiler backend - if "cleanup_dict" in kernel_options and isinstance(self.dev, CompilerFunctions): + if kernel_options["cleanup_dict"] and isinstance(self.dev, CompilerFunctions): cleanup_dict = kernel_options["cleanup_dict"] args_len = cleanup_dict["args_len"] kernel_name = kernel_options["kernel_name"]