[mlir][sparse] Extend sparse_tensor.sort with a enum attribute to specify a sorting implementation.
Currently, all the non-stable sorting algorithms are implemented via the straightforward quick sort. This will be fixed in the following PR. Reviewed By: aartbik Differential Revision: https://reviews.llvm.org/D142678
This commit is contained in:
@@ -819,7 +819,8 @@ public:
|
||||
// in the "added" array prior to applying the compression.
|
||||
unsigned rank = dstType.getShape().size();
|
||||
if (isOrderedDim(dstType, rank - 1))
|
||||
rewriter.create<SortOp>(loc, count, ValueRange{added}, ValueRange{});
|
||||
rewriter.create<SortOp>(loc, count, ValueRange{added}, ValueRange{},
|
||||
SparseTensorSortKind::HybridQuickSort);
|
||||
// While performing the insertions, we also need to reset the elements
|
||||
// of the values/filled-switch by only iterating over the set elements,
|
||||
// to ensure that the runtime complexity remains proportional to the
|
||||
|
||||
Reference in New Issue
Block a user