Skip to content

Commit 4e01734

Browse files
committed
Don't check tensor when comparing IndexSets
This fixes a bug where kernels would never get cached when using index sets, since the indexSetModes of the assignment would never compare as equal.
1 parent ef99f8d commit 4e01734

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/index_notation/index_notation.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,20 @@ struct Isomorphic : public IndexNotationVisitorStrict {
189189
}
190190
}
191191
if (anode->isAccessingStructure != bnode->isAccessingStructure ||
192-
anode->windowedModes != bnode->windowedModes ||
193-
anode->indexSetModes != bnode->indexSetModes) {
192+
anode->windowedModes != bnode->windowedModes) {
193+
eq = false;
194+
return;
195+
}
196+
if (anode->indexSetModes.size() != bnode->indexSetModes.size()) {
194197
eq = false;
195198
return;
196199
}
200+
for (auto aset = anode->indexSetModes.begin(), bset = bnode->indexSetModes.begin(); aset != anode->indexSetModes.end(); ++aset, ++bset) {
201+
if (aset->first != bset->first || *aset->second.set != *bset->second.set) {
202+
eq = false;
203+
return;
204+
}
205+
}
197206
eq = true;
198207
}
199208

0 commit comments

Comments
 (0)