Skip to content

Commit

Permalink
Fix missing updates to the GPU cache dictionary/set
Browse files Browse the repository at this point in the history
  • Loading branch information
davschneller committed Sep 13, 2023
1 parent 9402324 commit f8ecf51
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions yateto/ast/cost.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,13 @@ def estimate_Product(self, node):
self._loaded_to_gpu_cache[node] = self._loaded_to_gpu_cache[left_term].union(self._loaded_to_gpu_cache[right_term])

extra_cost = 0
if not right_term in self._loaded_to_gpu_cache:
if not right_term in self._loaded_to_gpu_cache[node]:
self._loaded_to_gpu_cache[node].add(right_term)
rbb = self._cache[right_term]
extra_cost += rbb.size()

if node.indices[self._lead_dim] != left_term.indices[self._lead_dim]:
if not node.leftTerm in self._loaded_to_gpu_cache:
if not node.leftTerm in self._loaded_to_gpu_cache[node]:
self._loaded_to_gpu_cache[node].add(left_term)
lbb = self._cache[left_term]
extra_cost += lbb.size()
Expand Down

0 comments on commit f8ecf51

Please sign in to comment.