From 355ba532f8dd448303e2ede81279a5fdb862e4d6 Mon Sep 17 00:00:00 2001 From: Kaushik Kulkarni Date: Wed, 4 Dec 2024 21:06:23 +0530 Subject: [PATCH] Correct the check to see if loop priority is redundant --- loopy/schedule/tools.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/loopy/schedule/tools.py b/loopy/schedule/tools.py index 3858462b..f75e2c00 100644 --- a/loopy/schedule/tools.py +++ b/loopy/schedule/tools.py @@ -862,10 +862,12 @@ def _order_loop_nests( .ancestors(inner_iname_nest)) ancestors_of_outer_iname = (loop_nest_tree .ancestors(outer_iname_nest)) - if outer_iname in ancestors_of_inner_iname: + if any(outer_iname in ancestor + for ancestor in ancestors_of_inner_iname): # nesting constraint already satisfied => do nothing pass - elif inner_iname in ancestors_of_outer_iname: + elif any(inner_iname in ancestor + for ancestor in ancestors_of_outer_iname): cannot_satisfy_callback("Cannot satisfy constraint that" f" iname '{inner_iname}' must be" f" nested within '{outer_iname}''.") -- GitLab