From 07ca0351976b18689760dea86014efcf5cbc2f08 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Sun, 15 Feb 2026 08:32:17 -0600 Subject: [PATCH 1/2] Ignore irrelevant instances of RUF069 --- test/test_c_execution.py | 2 +- test/test_statistics.py | 4 ++-- test/test_target.py | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/test_c_execution.py b/test/test_c_execution.py index f2f2b9c14..255a78c71 100644 --- a/test/test_c_execution.py +++ b/test/test_c_execution.py @@ -363,7 +363,7 @@ def test_scalar_global_args(): "res = sum(i, i)", target=lp.ExecutableCTarget())(n=n) - assert out == (n*(n-1)/2) + assert out == (n*(n-1)/2) # noqa: RUF069 if __name__ == "__main__": diff --git a/test/test_statistics.py b/test/test_statistics.py index ce3f0d0f9..5bc22ab4c 100644 --- a/test/test_statistics.py +++ b/test/test_statistics.py @@ -1081,7 +1081,7 @@ def test_all_counters_parallel_matmul(): sync_map = lp.get_synchronization_map(knl) assert len(sync_map) == 2 assert sync_map.filter_by(kind="kernel_launch").eval_and_sum(params) == 1 - assert sync_map.filter_by(kind="barrier_local").eval_and_sum(params) == 2*m/bsize + assert sync_map.filter_by(kind="barrier_local").eval_and_sum(params) == 2*m/bsize # noqa: RUF069 op_map = lp.get_op_map(knl, subgroup_size=SGS, count_redundant_work=True) f32mul = op_map[ @@ -1164,7 +1164,7 @@ def test_all_counters_parallel_matmul(): ).eval_and_sum(params) # (count-per-sub-group)*n_subgroups - assert local_mem_s == m*2/bsize*n_subgroups + assert local_mem_s == m*2/bsize*n_subgroups # noqa: RUF069 def test_floor_div_coefficient_collector(): diff --git a/test/test_target.py b/test/test_target.py index 316cfc5e0..69c36620a 100644 --- a/test/test_target.py +++ b/test/test_target.py @@ -223,7 +223,7 @@ def test_tuple(ctx_factory: cl.CtxFactory): _evt, (a, b) = knl(queue) assert a.get() == 1 - assert b.get() == 2. + assert b.get() == 2. # noqa: RUF069 def test_clamp(ctx_factory: cl.CtxFactory): @@ -334,7 +334,7 @@ def test_pyopencl_execution_numpy_handling(ctx_factory: cl.CtxFactory): x = np.array([4.]) _evt, out = knl(queue, y=y, x=x) assert out[0] is x - assert x[0] == 7. + assert x[0] == 7. # noqa: RUF069 # test numpy input for x is written to and returned, even when a pyopencl array # is passed for y @@ -343,7 +343,7 @@ def test_pyopencl_execution_numpy_handling(ctx_factory: cl.CtxFactory): x = np.array([4.]) _evt, out = knl(queue, y=y, x=x) assert out[0] is x - assert x[0] == 7. + assert x[0] == 7. # noqa: RUF069 # test numpy input for x is written to and returned, even when output-only knl = lp.make_kernel("{:}", ["x[0] = y[0] + 2"]) @@ -352,7 +352,7 @@ def test_pyopencl_execution_numpy_handling(ctx_factory: cl.CtxFactory): x = np.array([4.]) _evt, out = knl(queue, y=y, x=x) assert out[0] is x - assert x[0] == 5. + assert x[0] == 5. # noqa: RUF069 def test_opencl_support_for_bool(ctx_factory: cl.CtxFactory): From 3b394dab0e48938a7de0d733ccd4537e9224dd27 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Sun, 15 Feb 2026 08:46:35 -0600 Subject: [PATCH 2/2] Add some types to ExecutorBase attributes --- loopy/target/execution.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/loopy/target/execution.py b/loopy/target/execution.py index 803bc3f06..20deb412d 100644 --- a/loopy/target/execution.py +++ b/loopy/target/execution.py @@ -47,16 +47,18 @@ from pytools.persistent_dict import WriteOncePersistentDict from loopy.kernel import KernelState, LoopKernel -from loopy.kernel.data import ArrayArg, _ArraySeparationInfo, auto from loopy.tools import LoopyKeyBuilder, caches from loopy.types import LoopyType, NumpyType -from loopy.typing import Expression, integer_expr_or_err +from loopy.typing import auto, integer_expr_or_err from loopy.version import DATA_MODEL_VERSION if TYPE_CHECKING: - from collections.abc import Callable, Mapping, Sequence + from collections.abc import Callable, Mapping, Sequence, Set + from pymbolic.typing import Expression + + from loopy.kernel.data import ArrayArg, _ArraySeparationInfo from loopy.schedule.tools import KernelArgInfo from loopy.translation_unit import TranslationUnit @@ -766,7 +768,13 @@ class ExecutorBase: .. automethod:: __call__ """ + t_unit: TranslationUnit packing_controller: SeparateArrayPackingController | None + entrypoint: str + input_array_names: Set[str] + has_runtime_typed_args: bool + separated_entry_knl: LoopKernel + sep_info: dict[str, _ArraySeparationInfo] def __init__(self, t_unit: TranslationUnit, entrypoint: str): self.t_unit = t_unit