Skip to content

Commit

Permalink
_ReductionInameUniquifier: speed up get_cache_key
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer and matthiasdiener committed Jan 30, 2025
1 parent e3b96cc commit af6b663
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions loopy/transform/iname.py
Original file line number Diff line number Diff line change
Expand Up @@ -1600,9 +1600,9 @@ def __init__(self, rule_mapping_context, inames, within):
self.iname_to_nonsimultaneous_red_count = {}

def get_cache_key(self, expr, expn_state):
return (super().get_cache_key(expr, expn_state)
+ tuple(sorted(self.iname_to_red_count.items()))
+ tuple(sorted(self.iname_to_nonsimultaneous_red_count.items()))
return (super().get_cache_key(expr, expn_state),
hash(frozenset(self.iname_to_red_count.items())),
hash(frozenset(self.iname_to_nonsimultaneous_red_count.items())),
)

def map_reduction(self, expr, expn_state):
Expand Down

0 comments on commit af6b663

Please sign in to comment.