[mlir][sparse] add util for ToCoordinatesBuffer for COO AoS

Reviewed By: Peiming

Differential Revision: https://reviews.llvm.org/D150382
This commit is contained in:
Aart Bik
2023-05-11 10:05:16 -07:00
parent 677f7cc55a
commit 1e0966cd6c
3 changed files with 12 additions and 3 deletions

View File

@@ -895,9 +895,7 @@ private:
// coordinates for the storage ordering of the dst tensor. Use SortCoo
// if the COO tensor has the same ordering as the dst tensor.
if (dimRank > 1 && srcTp.hasSameDimToLvlMap(dstTp)) {
MemRefType coordsTp =
get1DMemRefType(encSrc.getCrdType(), /*withLayout=*/false);
Value xs = rewriter.create<ToCoordinatesBufferOp>(loc, coordsTp, src);
Value xs = genToCoordinatesBuffer(rewriter, loc, src);
rewriter.create<SortCooOp>(
loc, nnz, xs, ValueRange{y}, rewriter.getIndexAttr(dimRank),
rewriter.getIndexAttr(0), SparseTensorSortKind::HybridQuickSort);