Skip to content

Commit

Permalink
Changes SPMM tranform requirement. Unsure about this
Browse files Browse the repository at this point in the history
  • Loading branch information
rawnhenry committed Dec 25, 2020
1 parent 46aed13 commit 8471869
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/index_notation/transformations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1114,16 +1114,19 @@ static IndexStmt optimizeSpMM(IndexStmt stmt) {
return stmt;
}

// I think we can to linear combination of rows as long as there are no permutations in the format and the
// level formats are ordered. The i -> k -> j loops should iterate over the data structures without issue.
TensorVar B = Baccess.getTensorVar();
if (B.getFormat().getModeOrdering()[0] != 0 ||
if (!B.getFormat().getModeFormats()[0].isOrdered() ||
!B.getFormat().getModeFormats()[1].isOrdered() ||
B.getFormat().getModeOrdering()[0] != 0 ||
B.getFormat().getModeOrdering()[1] != 1) {
return stmt;
}

// We need random access into the first mode or this tensor in order to perform a linear combination of rows
// algorithm. (I think?)
TensorVar C = Caccess.getTensorVar();
if (!C.getFormat().getModeFormats()[0].hasLocate() ||
if (!C.getFormat().getModeFormats()[0].isOrdered() ||
!C.getFormat().getModeFormats()[1].isOrdered() ||
C.getFormat().getModeOrdering()[0] != 0 ||
C.getFormat().getModeOrdering()[1] != 1) {
return stmt;
Expand Down

0 comments on commit 8471869

Please sign in to comment.