Replace the quick sort partition method with one that is more similar to the
method used by C++ std quick sort. This improves the runtime for sorting
sk_2005.mtx by more than 10x.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/lib/Dialect/SparseTensor/Transforms/SparseBufferRewriting.cpp | ||
---|---|---|
145 | Here and below, super nit, but "whether x[i] is equal to x[j]." reads a bit better? | |
180 | is this line correct? seems from the less than code? | |
339 | assert(step < 0) or explicit test and third branch not reached? | |
mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_rewrite_sort.mlir | ||
85 | is this now stable too, or by luck? |
Comment Actions
Address review comments.
mlir/lib/Dialect/SparseTensor/Transforms/SparseBufferRewriting.cpp | ||
---|---|---|
145 | Agree, fixed here and below. | |
180 | should compare x2[i] != x2[j]. thanks for catching this. | |
339 | add assert. | |
mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_rewrite_sort.mlir | ||
85 | By luck. The algorithm may or may not maintain the order of equal elements. |
Here and below, super nit, but
"whether x[i] is equal to x[j]."
reads a bit better?