Skip to content

Commit 270daf8

Browse files
committed
add comments to address review and remove more prints
1 parent f0b25a1 commit 270daf8

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

include/taco/index_notation/index_notation.h

+7
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,13 @@ class IndexStmt : public util::IntrusivePtr<const IndexStmtNode> {
648648

649649
/// The loopfuse transformation fuses common outer loops in
650650
/// 2 iteration graphs.
651+
/// when performing loopfuse operation on an already branched index statement
652+
/// eg: forall(l, where(forall(ijk, T(j,k) += A*B), forall(mjkn, X(l,m,n) += T*C*D)))
653+
/// and we want to further breakdown T*C*D into T2 = T*C and T2*D
654+
/// we can use the path vector to specify the branch we want to apply the fuse on
655+
/// eg: loopfuse(2, true, {1}) where 2 refers to breaking T*C*D at the 2nd position
656+
/// and true refers to making T*C as the producer (if false, then C*D will be the producer if used with 1)
657+
/// and {1} refers to the branch we want to apply the fuse on
651658
IndexStmt loopfuse(int pos, bool isProducerOnLeft, std::vector<int>& path) const;
652659

653660

include/taco/parser/lexer.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ enum class Token {
2222
sub,
2323
mul,
2424
div,
25-
colon,
25+
colon, // numbers before the colon indicate the path to branch in a branched iteration graph
2626
eq,
2727
eot, // End of tokens
2828
error

src/index_notation/index_notation.cpp

+1-11
Original file line numberDiff line numberDiff line change
@@ -1855,15 +1855,7 @@ IndexStmt IndexStmt::divide(IndexVar i, IndexVar i1, IndexVar i2, size_t splitFa
18551855
}
18561856

18571857
IndexStmt IndexStmt::loopfuse(int pos, bool isProducerOnLeft, vector<int>& path) const {
1858-
1859-
std::cout << "Loop fuse pos: " << pos;
1860-
std::cout << ", Loop fuse isProducerOnLeft: " << isProducerOnLeft;
1861-
for (const auto& p : path) {
1862-
std::cout << " " << p;
1863-
}
1864-
std::cout << std::endl;
1865-
1866-
string reason;
1858+
string reason; // reason saves the error message if the transformation fails
18671859
IndexStmt transformed = *this;
18681860
transformed = Transformation(LoopFuse(pos, isProducerOnLeft, path)).apply(transformed, &reason);
18691861
if (!transformed.defined()) {
@@ -1929,8 +1921,6 @@ IndexStmt IndexStmt::reorder(std::vector<IndexVar> reorderedvars) const {
19291921

19301922
IndexStmt IndexStmt::reorder(std::vector<int> path, std::vector<IndexVar> reorderedvars) const {
19311923
string reason;
1932-
cout << "Index statement path: " << util::join(path) << endl;
1933-
cout << "Index statement reorderedvars: " << reorderedvars << endl;
19341924
IndexStmt transformed = Reorder(path, reorderedvars).apply(*this, &reason);
19351925
if (!transformed.defined()) {
19361926
taco_uerror << reason;

0 commit comments

Comments
 (0)