From a8b92da0c75849dbb1b33da70d6de306d5bde482 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Sat, 10 Feb 2018 01:41:15 -0600 Subject: [PATCH] check_variable_access_ordered: Require nosync in both directions --- loopy/check.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/loopy/check.py b/loopy/check.py index ebe919838..bd79cbea9 100644 --- a/loopy/check.py +++ b/loopy/check.py @@ -432,13 +432,16 @@ def needs_no_sync_with(kernel, var_scope, dep_a, dep_b): else: raise ValueError("unexpected value of 'temp_var_scope'") + ab_nosync = False + ba_nosync = False + for scope in search_scopes: - if (dep_a_id, scope) in dep_b.no_sync_with: - return True - if (dep_b_id, scope) in dep_a.no_sync_with: - return True + if (dep_a.id, scope) in dep_b.no_sync_with: + ab_nosync = True + if (dep_b.id, scope) in dep_a.no_sync_with: + ba_nosync = True - return False + return ab_nosync and ba_nosync def check_variable_access_ordered(kernel): -- GitLab