No need for a temp COO and sort even when converting dense -> CSC, we can instead rotate the loop to yield a ordered coordinates at beginning.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.td | ||
---|---|---|
1161 | you will need to document the new attribute In fact ,perhaps just add a section on 'tensor' : .... | |
mlir/lib/Dialect/SparseTensor/Transforms/CodegenUtils.cpp | ||
510 | int -> unsigned, here and below (unless that gives compile time warnings/errors) | |
520 | period at end |
mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.td | ||
---|---|---|
1166 | Do you actually mean dimensions here? or levels? |
mlir/lib/Dialect/SparseTensor/Transforms/CodegenUtils.cpp | ||
---|---|---|
510 | Actually, you should use Dimension for here and the next loop (and use Dimension dimRank above). Assuming I'm reading this correctly. Or if they're supposed to be levels instead, then use Level and Level lvlRank. |
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp | ||
---|---|---|
941 | I'm thinking this i should be l? Then again, since coords is initialized to dimRank, that suggests this loop should really be (Level l = 0; l < lvlRank; l++) and then i should be d |
address comments.
mlir/lib/Dialect/SparseTensor/Transforms/CodegenUtils.cpp | ||
---|---|---|
510 | I updated the inner loop, but the outer loop should be size_t, which equals to nnz here |
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp | ||
---|---|---|
677 | It would be better style to use if (auto order = encDst.getDimOrdering()) here, so that you don't need to repeat that method call in the body |
you will need to document the new attribute
In fact ,perhaps just add a section on
'tensor' : ....
'initArgs' : ...
'order' : ...