From 08c0e925cf77fa0ef038c2ae2ebace1289befd9d Mon Sep 17 00:00:00 2001 From: jdsteve2 Date: Sun, 22 Mar 2020 15:01:52 -0500 Subject: [PATCH 01/25] move code for getting used inames into separate function: get_used_inames() --- loopy/transform/iname.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/loopy/transform/iname.py b/loopy/transform/iname.py index 96c8252ef..91170647b 100644 --- a/loopy/transform/iname.py +++ b/loopy/transform/iname.py @@ -1184,6 +1184,19 @@ def rename_iname(knl, old_iname, new_iname, existing_ok=False, within=None): # {{{ remove unused inames +def get_used_inames(knl): + import loopy as lp + exp_knl = lp.expand_subst(knl) + + used_inames = set() + for insn in exp_knl.instructions: + used_inames.update( + exp_knl.insn_inames(insn.id) + | insn.reduction_inames()) + + return used_inames + + def remove_unused_inames(knl, inames=None): """Delete those among *inames* that are unused, i.e. project them out of the domain. If these inames pose implicit restrictions on @@ -1204,17 +1217,7 @@ def remove_unused_inames(knl, inames=None): # {{{ check which inames are unused - import loopy as lp - exp_knl = lp.expand_subst(knl) - - inames = set(inames) - used_inames = set() - for insn in exp_knl.instructions: - used_inames.update( - exp_knl.insn_inames(insn.id) - | insn.reduction_inames()) - - unused_inames = inames - used_inames + unused_inames = set(inames) - get_used_inames(knl) # }}} -- GitLab From 1bbf20b52e781ace1a87f516e54df85d3f530ff9 Mon Sep 17 00:00:00 2001 From: jdsteve2 Date: Sun, 22 Mar 2020 15:03:52 -0500 Subject: [PATCH 02/25] add pre-linearization check for unused inames --- loopy/check.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/loopy/check.py b/loopy/check.py index 0d2bbff7c..1acb2242e 100644 --- a/loopy/check.py +++ b/loopy/check.py @@ -184,6 +184,16 @@ def check_for_inactive_iname_access(kernel): ", ".join(expression_inames - kernel.insn_inames(insn)))) +def check_for_unused_inames(kernel): + # don't linearize if kernel has unused inames + from loopy.transform.iname import get_used_inames + unused_inames = kernel.all_inames() - get_used_inames(kernel) + if unused_inames: + raise LoopyError( + "cannot linearize a kernel with unused inames: %s" + % (unused_inames)) + + def _is_racing_iname_tag(tv, tag): from loopy.kernel.data import (AddressSpace, LocalIndexTagBase, GroupIndexTag, ConcurrentTag, auto) @@ -658,6 +668,7 @@ def pre_schedule_checks(kernel): check_loop_priority_inames_known(kernel) check_multiple_tags_allowed(kernel) check_for_inactive_iname_access(kernel) + check_for_unused_inames(kernel) check_for_write_races(kernel) check_for_data_dependent_parallel_bounds(kernel) check_bounds(kernel) -- GitLab From 46bee870d3ae6278cb1a578f2858a6ae81a377ef Mon Sep 17 00:00:00 2001 From: jdsteve2 Date: Sun, 22 Mar 2020 15:12:33 -0500 Subject: [PATCH 03/25] remove unused iname ell3 from test_poisson_fem --- test/test_apps.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_apps.py b/test/test_apps.py index e07262dbd..71029cc9c 100644 --- a/test/test_apps.py +++ b/test/test_apps.py @@ -566,7 +566,7 @@ def test_poisson_fem(ctx_factory): sdim = 3 knl = lp.make_kernel( - "{ [c,i,j,k,ell,ell2,ell3]: \ + "{ [c,i,j,k,ell,ell2]: \ 0 <= c < nels and \ 0 <= i < nbf and \ 0 <= j < nbf and \ -- GitLab From 9a81591502f6dcdb6ea1bac9ccffcb3a95447b0e Mon Sep 17 00:00:00 2001 From: jdsteve2 Date: Sun, 22 Mar 2020 15:13:40 -0500 Subject: [PATCH 04/25] remove unused iname from test_eq_constraint --- test/test_domain.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_domain.py b/test/test_domain.py index ebfde8509..5daf84eaa 100644 --- a/test/test_domain.py +++ b/test/test_domain.py @@ -111,7 +111,7 @@ def test_eq_constraint(ctx_factory): ctx = ctx_factory() knl = lp.make_kernel( - "{[i,j]: 0<= i,j < 32}", + "{[i]: 0<= i < 32}", [ "a[i] = b[i]" ], -- GitLab From c78d2f6677c631f356c5ffd169c647c0a274b897 Mon Sep 17 00:00:00 2001 From: jdsteve2 Date: Sun, 22 Mar 2020 15:16:49 -0500 Subject: [PATCH 05/25] remove unused iname from test_tuple --- test/test_target.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/test_target.py b/test/test_target.py index bcf85a340..038b2e6c0 100644 --- a/test/test_target.py +++ b/test/test_target.py @@ -231,8 +231,9 @@ def test_tuple(ctx_factory): ctx = ctx_factory() queue = cl.CommandQueue(ctx) + import islpy as isl knl = lp.make_kernel( - "{ [i]: 0 = i }", + [isl.BasicSet("[] -> {[]: }")], """ a, b = make_tuple(1, 2.) """) -- GitLab From c05e070f333dc9a93977d13ea39963619780ae10 Mon Sep 17 00:00:00 2001 From: jdsteve2 Date: Sun, 22 Mar 2020 15:18:33 -0500 Subject: [PATCH 06/25] remove unused iname gi from test_tim2d and comment out duplicate_inames calls whose within id doesn't match anything --- test/test_sem_reagan.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/test_sem_reagan.py b/test/test_sem_reagan.py index e022e92f3..54c64e0a4 100644 --- a/test/test_sem_reagan.py +++ b/test/test_sem_reagan.py @@ -48,7 +48,7 @@ def test_tim2d(ctx_factory): # K - run-time symbolic knl = lp.make_kernel( - "{[i,j,e,m,o,o2,gi]: 0<=i,j,m,o,o2 Date: Sun, 22 Mar 2020 15:22:11 -0500 Subject: [PATCH 07/25] remove unused iname k from test_collect_common_factors --- test/test_transform.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_transform.py b/test/test_transform.py index 6eb6697b5..559f8f48e 100644 --- a/test/test_transform.py +++ b/test/test_transform.py @@ -74,7 +74,7 @@ def test_collect_common_factors(ctx_factory): ctx = ctx_factory() knl = lp.make_kernel( - "{[i,j,k]: 0<=i,j out_tmp = 0 {id=out_init,inames=i} out_tmp = out_tmp + alpha[i]*a[i,j]*b1[j] {id=out_up1,dep=out_init} -- GitLab From b784b86e788bf0a2e745bd35b08eb62b1e22eef4 Mon Sep 17 00:00:00 2001 From: jdsteve2 Date: Sun, 22 Mar 2020 15:23:06 -0500 Subject: [PATCH 08/25] remove unused iname j from test_precompute_nested_subst --- test/test_transform.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/test_transform.py b/test/test_transform.py index 559f8f48e..2c9415f3c 100644 --- a/test/test_transform.py +++ b/test/test_transform.py @@ -385,7 +385,7 @@ def test_precompute_nested_subst(ctx_factory): ctx = ctx_factory() knl = lp.make_kernel( - "{[i,j]: 0<=i Date: Sun, 22 Mar 2020 15:25:39 -0500 Subject: [PATCH 09/25] remove unused iname i from test_scalars_with_base_storage --- test/test_loopy.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/test_loopy.py b/test/test_loopy.py index 6b78ac26b..27c5b19b4 100644 --- a/test/test_loopy.py +++ b/test/test_loopy.py @@ -1926,8 +1926,9 @@ def test_scalars_with_base_storage(ctx_factory): ctx = ctx_factory() queue = cl.CommandQueue(ctx) + import islpy as isl knl = lp.make_kernel( - "{ [i]: 0<=i<1}", + [isl.BasicSet("[] -> {[]: }")], # empty (domain w/unused inames errors) "a = 1", [lp.TemporaryVariable("a", dtype=np.float64, shape=(), base_storage="base")]) -- GitLab From 89c91e1936a9dee45d606f11e9c37101e9501861 Mon Sep 17 00:00:00 2001 From: jdsteve2 Date: Sun, 22 Mar 2020 15:26:25 -0500 Subject: [PATCH 10/25] remove unused iname j from test_atomic_init --- test/test_loopy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_loopy.py b/test/test_loopy.py index 27c5b19b4..ec9c8d473 100644 --- a/test/test_loopy.py +++ b/test/test_loopy.py @@ -952,7 +952,7 @@ def test_atomic_init(dtype): vec_width = 4 knl = lp.make_kernel( - "{ [i,j]: 0<=i<100 }", + "{ [i]: 0<=i<100 }", """ out[i%4] = 0 {id=init, atomic=init} """, -- GitLab From cfb9c49b4e685fb78316c2bb96023fa5e8afade5 Mon Sep 17 00:00:00 2001 From: jdsteve2 Date: Sun, 22 Mar 2020 15:27:11 -0500 Subject: [PATCH 11/25] remove unused iname e from test_multiple_writes_to_local_temporary --- test/test_loopy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_loopy.py b/test/test_loopy.py index ec9c8d473..64a3b9dbc 100644 --- a/test/test_loopy.py +++ b/test/test_loopy.py @@ -769,7 +769,7 @@ def test_multiple_writes_to_local_temporary(): # writes are OK. knl = lp.make_kernel( - "{[i,e]: 0<=i<5 and 0<=e temp[i, 0] = 17 temp[i, 1] = 15 -- GitLab From efb54017e3d048f545db5c0876ed70157f925b96 Mon Sep 17 00:00:00 2001 From: jdsteve2 Date: Sun, 22 Mar 2020 15:28:24 -0500 Subject: [PATCH 12/25] remove unused iname idim from test_dependent_domain_insn_iname_finding --- test/test_loopy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_loopy.py b/test/test_loopy.py index 64a3b9dbc..bb53532b7 100644 --- a/test/test_loopy.py +++ b/test/test_loopy.py @@ -564,7 +564,7 @@ def test_dependent_domain_insn_iname_finding(ctx_factory): knl = lp.make_kernel([ "{[isrc_box]: 0<=isrc_box src_ibox = source_boxes[isrc_box] -- GitLab From 76dc9a3f1ffdb4c200fa4b407904be4ddd804148 Mon Sep 17 00:00:00 2001 From: jdsteve2 Date: Sun, 22 Mar 2020 15:29:05 -0500 Subject: [PATCH 13/25] remove unused iname j from test_nonlinear_index --- test/test_loopy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_loopy.py b/test/test_loopy.py index bb53532b7..cb0be2282 100644 --- a/test/test_loopy.py +++ b/test/test_loopy.py @@ -456,7 +456,7 @@ def test_nonlinear_index(ctx_factory): ctx = ctx_factory() knl = lp.make_kernel( - "{[i,j]: 0<=i,j Date: Sun, 22 Mar 2020 15:29:38 -0500 Subject: [PATCH 14/25] remove unused iname j from test_simple_side_effect --- test/test_loopy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_loopy.py b/test/test_loopy.py index cb0be2282..af9281670 100644 --- a/test/test_loopy.py +++ b/test/test_loopy.py @@ -177,7 +177,7 @@ def test_simple_side_effect(ctx_factory): ctx = ctx_factory() knl = lp.make_kernel( - "{[i,j]: 0<=i,j<100}", + "{[i]: 0<=i<100}", """ a[i] = a[i] + 1 """, -- GitLab From c099ec13418bd09606c4119e3c8374d1fae8942e Mon Sep 17 00:00:00 2001 From: jdsteve2 Date: Sun, 22 Mar 2020 15:47:23 -0500 Subject: [PATCH 15/25] add N817 to ignore list for flake8 --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index eec3dfd1f..a0d95746e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [flake8] -ignore = E126,E127,E128,E123,E226,E241,E242,E265,N802,W503,E402,N814,W504 +ignore = E126,E127,E128,E123,E226,E241,E242,E265,N802,W503,E402,N814,N817,W504 max-line-length=85 exclude= loopy/target/c/compyte/ndarray, -- GitLab From a2682ea57cc4904e6ffaec39bf849061d00cdb4e Mon Sep 17 00:00:00 2001 From: jdsteve2 Date: Sun, 22 Mar 2020 15:50:50 -0500 Subject: [PATCH 16/25] Revert "add N817 to ignore list for flake8" This reverts commit c099ec13418bd09606c4119e3c8374d1fae8942e. --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index a0d95746e..eec3dfd1f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [flake8] -ignore = E126,E127,E128,E123,E226,E241,E242,E265,N802,W503,E402,N814,N817,W504 +ignore = E126,E127,E128,E123,E226,E241,E242,E265,N802,W503,E402,N814,W504 max-line-length=85 exclude= loopy/target/c/compyte/ndarray, -- GitLab From 61b77e5b74cab61c38557173aa3d172b7ae855da Mon Sep 17 00:00:00 2001 From: jdsteve2 Date: Sun, 22 Mar 2020 16:12:04 -0500 Subject: [PATCH 17/25] add remove_any_newly_unused_inames(transformation_func) decorator --- loopy/transform/iname.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/loopy/transform/iname.py b/loopy/transform/iname.py index 91170647b..a061ca111 100644 --- a/loopy/transform/iname.py +++ b/loopy/transform/iname.py @@ -1238,6 +1238,23 @@ def remove_unused_inames(knl, inames=None): return knl + +def remove_any_newly_unused_inames(transformation_func): + + def wrapper(knl, *args, **kwargs): + # determine which inames were already unused + inames_already_unused = knl.all_inames() - get_used_inames(knl) + + # call transform + transformed_knl = transformation_func(knl, *args, **kwargs) + + # Remove inames that are unused due to transform + return remove_unused_inames( + transformed_knl, + transformed_knl.all_inames()-inames_already_unused) + + return wrapper + # }}} -- GitLab From a218e44c76452da8a4064145feac69e7093458fc Mon Sep 17 00:00:00 2001 From: jdsteve2 Date: Sun, 22 Mar 2020 16:14:11 -0500 Subject: [PATCH 18/25] add @remove_any_newly_unused_inames decorator to realize_reduction --- loopy/preprocess.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/loopy/preprocess.py b/loopy/preprocess.py index 23c4b7fbd..221233ed0 100644 --- a/loopy/preprocess.py +++ b/loopy/preprocess.py @@ -37,6 +37,7 @@ from loopy.version import DATA_MODEL_VERSION from loopy.kernel.data import make_assignment, filter_iname_tags_by_type # for the benefit of loopy.statistics, for now from loopy.type_inference import infer_unknown_types +from loopy.transform.iname import remove_any_newly_unused_inames import logging logger = logging.getLogger(__name__) @@ -882,6 +883,7 @@ def _insert_subdomain_into_domain_tree(kernel, domains, subdomain): # }}} +@remove_any_newly_unused_inames def realize_reduction(kernel, insn_id_filter=None, unknown_types_ok=True, automagic_scans_ok=False, force_scan=False, force_outer_iname_for_scan=None): @@ -1924,8 +1926,6 @@ def realize_reduction(kernel, insn_id_filter=None, unknown_types_ok=True, kernel = lp.tag_inames(kernel, new_iname_tags) - # TODO: remove unused inames... - kernel = ( _hackily_ensure_multi_assignment_return_values_are_scoped_private( kernel)) -- GitLab From 443d0935ad27f3e149b6092f38c01d2dc5b3febc Mon Sep 17 00:00:00 2001 From: jdsteve2 Date: Sun, 22 Mar 2020 16:33:56 -0500 Subject: [PATCH 19/25] add remove_any_newly_unused_inames(transformation_func) decorator to assignment_to_subst --- loopy/transform/subst.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/loopy/transform/subst.py b/loopy/transform/subst.py index 3eee3d8f3..89244eb4e 100644 --- a/loopy/transform/subst.py +++ b/loopy/transform/subst.py @@ -27,6 +27,7 @@ import six from loopy.symbolic import ( RuleAwareIdentityMapper, SubstitutionRuleMappingContext) from loopy.diagnostic import LoopyError +from loopy.transform.iname import remove_any_newly_unused_inames from pytools import ImmutableRecord from pymbolic import var @@ -256,6 +257,7 @@ class AssignmentToSubstChanger(RuleAwareIdentityMapper): return var(subst_name)(*index) +@remove_any_newly_unused_inames def assignment_to_subst(kernel, lhs_name, extra_arguments=(), within=None, force_retain_argument=False): """Extract an assignment (to a temporary variable or an argument) -- GitLab From 285cfbc63aa7ca2634fdd8a48b986f461b84a284 Mon Sep 17 00:00:00 2001 From: jdsteve2 Date: Sun, 22 Mar 2020 16:34:50 -0500 Subject: [PATCH 20/25] remove _0 suffix from iname (now that 'j' is removed, var name generator produces different result) --- test/test_loopy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_loopy.py b/test/test_loopy.py index af9281670..61a3f167b 100644 --- a/test/test_loopy.py +++ b/test/test_loopy.py @@ -1555,7 +1555,7 @@ def test_finite_difference_expr_subst(ctx_factory): gpu_knl, "f_subst", "inew_inner", fetch_bounding_box=True, default_tag="l.auto") - precomp_knl = lp.tag_inames(precomp_knl, {"j_0_outer": "unr"}) + precomp_knl = lp.tag_inames(precomp_knl, {"j_outer": "unr"}) precomp_knl = lp.set_options(precomp_knl, return_dict=True) evt, _ = precomp_knl(queue, u=u, h=h) -- GitLab From 63d425826ecebbab2869e529e5513fa1aaf65368 Mon Sep 17 00:00:00 2001 From: jdsteve2 Date: Tue, 24 Mar 2020 01:20:33 -0500 Subject: [PATCH 21/25] make unused iname removal optional when remove_any_newly_unused_inames decorator is present on a transformation --- loopy/transform/iname.py | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/loopy/transform/iname.py b/loopy/transform/iname.py index a061ca111..1f9108bb7 100644 --- a/loopy/transform/iname.py +++ b/loopy/transform/iname.py @@ -1242,16 +1242,24 @@ def remove_unused_inames(knl, inames=None): def remove_any_newly_unused_inames(transformation_func): def wrapper(knl, *args, **kwargs): - # determine which inames were already unused - inames_already_unused = knl.all_inames() - get_used_inames(knl) - # call transform - transformed_knl = transformation_func(knl, *args, **kwargs) + # check for remove_unused_inames argument, default: True + remove_unused_inames = kwargs.pop("remove_unused_inames", True) - # Remove inames that are unused due to transform - return remove_unused_inames( - transformed_knl, - transformed_knl.all_inames()-inames_already_unused) + if remove_unused_inames: + # determine which inames were already unused + inames_already_unused = knl.all_inames() - get_used_inames(knl) + + # call transform + transformed_knl = transformation_func(knl, *args, **kwargs) + + # Remove inames that are unused due to transform + return remove_unused_inames( + transformed_knl, + transformed_knl.all_inames()-inames_already_unused) + else: + # call transform + return transformation_func(knl, *args, **kwargs) return wrapper -- GitLab From a140430d97972c556b703f28543b5d5e2790e417 Mon Sep 17 00:00:00 2001 From: jdsteve2 Date: Tue, 24 Mar 2020 01:28:19 -0500 Subject: [PATCH 22/25] change variable name that matched function name --- loopy/transform/iname.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/loopy/transform/iname.py b/loopy/transform/iname.py index 1f9108bb7..ed6fa4622 100644 --- a/loopy/transform/iname.py +++ b/loopy/transform/iname.py @@ -1244,9 +1244,9 @@ def remove_any_newly_unused_inames(transformation_func): def wrapper(knl, *args, **kwargs): # check for remove_unused_inames argument, default: True - remove_unused_inames = kwargs.pop("remove_unused_inames", True) + remove_newly_unused_inames = kwargs.pop("remove_newly_unused_inames", True) - if remove_unused_inames: + if remove_newly_unused_inames: # determine which inames were already unused inames_already_unused = knl.all_inames() - get_used_inames(knl) -- GitLab From 0114414071243e16ee583175a4e5637bdb797fa7 Mon Sep 17 00:00:00 2001 From: jdsteve2 Date: Fri, 27 Mar 2020 06:48:37 -0500 Subject: [PATCH 23/25] when unused inames are found upon linearization, warn instead of error --- loopy/check.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/loopy/check.py b/loopy/check.py index 1acb2242e..b4ef7d6fa 100644 --- a/loopy/check.py +++ b/loopy/check.py @@ -185,12 +185,15 @@ def check_for_inactive_iname_access(kernel): def check_for_unused_inames(kernel): - # don't linearize if kernel has unused inames + # Warn if kernel has unused inames from loopy.transform.iname import get_used_inames unused_inames = kernel.all_inames() - get_used_inames(kernel) if unused_inames: - raise LoopyError( - "cannot linearize a kernel with unused inames: %s" + warn_with_kernel( + kernel, "unused_inames", + "Found unused inames in kernel: %s " + "Unused inames during linearization will be prohibited in " + "Loopy version 2021.X." % (unused_inames)) -- GitLab From 390823cd6a1048de540391995162fd3d71059db3 Mon Sep 17 00:00:00 2001 From: jdsteve2 Date: Tue, 7 Apr 2020 06:30:39 -0500 Subject: [PATCH 24/25] remove unnecessary parens in warning --- loopy/check.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loopy/check.py b/loopy/check.py index b4ef7d6fa..da49c1d11 100644 --- a/loopy/check.py +++ b/loopy/check.py @@ -194,7 +194,7 @@ def check_for_unused_inames(kernel): "Found unused inames in kernel: %s " "Unused inames during linearization will be prohibited in " "Loopy version 2021.X." - % (unused_inames)) + % unused_inames) def _is_racing_iname_tag(tv, tag): -- GitLab From 63af66c75823b22b892ebfc367fb52a2384929f0 Mon Sep 17 00:00:00 2001 From: jdsteve2 Date: Tue, 7 Apr 2020 06:31:15 -0500 Subject: [PATCH 25/25] add @wraps to prevent docstring issues in wrapper in remove_any_newly_unused_inames --- loopy/transform/iname.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/loopy/transform/iname.py b/loopy/transform/iname.py index ed6fa4622..ae717e1c7 100644 --- a/loopy/transform/iname.py +++ b/loopy/transform/iname.py @@ -1240,7 +1240,9 @@ def remove_unused_inames(knl, inames=None): def remove_any_newly_unused_inames(transformation_func): + from functools import wraps + @wraps(transformation_func) def wrapper(knl, *args, **kwargs): # check for remove_unused_inames argument, default: True -- GitLab