diff --git a/loopy/check.py b/loopy/check.py index ebe91983886d7899fb1d8b57616f764ee21393ba..bd79cbea9795c38ec0d0d06874457df834bdc309 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):