Skip to content

Commit

Permalink
also address scan kernel cache
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasdiener committed Apr 23, 2024
1 parent 226a52e commit 980c3db
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pyopencl/scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -1141,7 +1141,8 @@ def finish_setup(self) -> None:
pass


generic_scan_kernel_cache = WriteOncePersistentDict(
if not cl._PYOPENCL_NO_CACHE:
generic_scan_kernel_cache = WriteOncePersistentDict(
"pyopencl-generated-scan-kernel-cache-v1",
key_builder=_NumpyTypesKeyBuilder(),
in_mem_cache_size=0)
Expand Down Expand Up @@ -1199,7 +1200,8 @@ def finish_setup(self) -> None:
self.second_level_scan_gen_info,
self.final_update_gen_info)

generic_scan_kernel_cache.store_if_not_present(cache_key, result)
if not cl._PYOPENCL_NO_CACHE:
generic_scan_kernel_cache.store_if_not_present(cache_key, result)

# Build the kernels.
self.first_level_scan_info = self.first_level_scan_gen_info.build(
Expand Down

0 comments on commit 980c3db

Please sign in to comment.