Skip to content

Commit

Permalink
fix: NoneType object is not subscriptable for setup_dict and cleanup_…
Browse files Browse the repository at this point in the history
…dict
  • Loading branch information
MiloLurati committed Jan 20, 2025
1 parent a4104c0 commit 267d735
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel_tuner/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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"]
Expand Down

0 comments on commit 267d735

Please sign in to comment.