Skip to content

Commit f63d440

Browse files
committed
Add in multiple precompute rel nodes for ProvenanceGraph with multidimensional ws indexvars
1 parent 392fc66 commit f63d440

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

src/index_notation/index_notation.cpp

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1536,13 +1536,20 @@ IndexStmt IndexStmt::precompute(IndexExpr expr, std::vector<IndexVar> i_vars,
15361536
string reason;
15371537

15381538
// FIXME: need to re-enable this later
1539-
// if (i != iw) {
1540-
// IndexVarRel rel = IndexVarRel(new PrecomputeRelNode(i, iw));
1541-
// transformed = Transformation(AddSuchThatPredicates({rel})).apply(transformed, &reason);
1542-
// if (!transformed.defined()) {
1543-
// taco_uerror << reason;
1544-
// }
1545-
// }
1539+
taco_uassert(i_vars.size() == iw_vars.size()) << "The precompute transformation requires"
1540+
<< "i_vars and iw_vars to be the same size";
1541+
for (int l = 0; l < i_vars.size(); l++) {
1542+
IndexVar i = i_vars.at(l);
1543+
IndexVar iw = iw_vars.at(l);
1544+
1545+
if (i != iw) {
1546+
IndexVarRel rel = IndexVarRel(new PrecomputeRelNode(i, iw));
1547+
transformed = Transformation(AddSuchThatPredicates({rel})).apply(transformed, &reason);
1548+
if (!transformed.defined()) {
1549+
taco_uerror << reason;
1550+
}
1551+
}
1552+
}
15461553

15471554
transformed = Transformation(Precompute(expr, i_vars, iw_vars, workspace)).apply(transformed, &reason);
15481555

0 commit comments

Comments
 (0)