File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -1114,16 +1114,19 @@ static IndexStmt optimizeSpMM(IndexStmt stmt) {
11141114 return stmt;
11151115 }
11161116
1117+ // I think we can to linear combination of rows as long as there are no permutations in the format and the
1118+ // level formats are ordered. The i -> k -> j loops should iterate over the data structures without issue.
11171119 TensorVar B = Baccess.getTensorVar ();
1118- if (B.getFormat ().getModeOrdering ()[0 ] != 0 ||
1120+ if (!B.getFormat ().getModeFormats ()[0 ].isOrdered () ||
1121+ !B.getFormat ().getModeFormats ()[1 ].isOrdered () ||
1122+ B.getFormat ().getModeOrdering ()[0 ] != 0 ||
11191123 B.getFormat ().getModeOrdering ()[1 ] != 1 ) {
11201124 return stmt;
11211125 }
11221126
1123- // We need random access into the first mode or this tensor in order to perform a linear combination of rows
1124- // algorithm. (I think?)
11251127 TensorVar C = Caccess.getTensorVar ();
1126- if (!C.getFormat ().getModeFormats ()[0 ].hasLocate () ||
1128+ if (!C.getFormat ().getModeFormats ()[0 ].isOrdered () ||
1129+ !C.getFormat ().getModeFormats ()[1 ].isOrdered () ||
11271130 C.getFormat ().getModeOrdering ()[0 ] != 0 ||
11281131 C.getFormat ().getModeOrdering ()[1 ] != 1 ) {
11291132 return stmt;
You can’t perform that action at this time.
0 commit comments