[mlir][sparse] Correcting some terminology / naming-scheme errors.
The name "coords" should be used for the complete tuple of Dimension-/Level-many "crd" values associated with a single element. Whereas the name "coordinates" should only be used for collections of "crd" values which span several elements (e.g., the tensor's coordinates buffer for a single level). Reviewed By: aartbik Differential Revision: https://reviews.llvm.org/D147291
This commit is contained in:
@@ -420,7 +420,7 @@ static void genInsertBody(OpBuilder &builder, ModuleOp module,
|
||||
// Extract fields and coordinates from args.
|
||||
SmallVector<Value> fields = llvm::to_vector(args.drop_back(lvlRank + 1));
|
||||
MutSparseTensorDescriptor desc(rtp, fields);
|
||||
const SmallVector<Value> coordinates =
|
||||
const SmallVector<Value> coords =
|
||||
llvm::to_vector(args.take_back(lvlRank + 1).drop_back());
|
||||
Value value = args.back();
|
||||
Value parentPos = constantZero(builder, loc, builder.getIndexType());
|
||||
@@ -436,14 +436,14 @@ static void genInsertBody(OpBuilder &builder, ModuleOp module,
|
||||
// positions[l] = coordinates.size() - 1
|
||||
// <insert @ positions[l] at next level l + 1>
|
||||
parentPos =
|
||||
genCompressed(builder, loc, desc, coordinates, value, parentPos, l);
|
||||
genCompressed(builder, loc, desc, coords, value, parentPos, l);
|
||||
} else if (isSingletonDLT(dlt)) {
|
||||
// Create:
|
||||
// coordinates[l].push_back(coords[l])
|
||||
// positions[l] = positions[l-1]
|
||||
// <insert @ positions[l] at next level l + 1>
|
||||
createPushback(builder, loc, desc, SparseTensorFieldKind::CrdMemRef, l,
|
||||
coordinates[l]);
|
||||
coords[l]);
|
||||
} else {
|
||||
assert(isDenseDLT(dlt));
|
||||
// Construct the new position as:
|
||||
@@ -451,7 +451,7 @@ static void genInsertBody(OpBuilder &builder, ModuleOp module,
|
||||
// <insert @ positions[l] at next level l + 1>
|
||||
Value size = sizeFromTensorAtLvl(builder, loc, desc, l);
|
||||
Value mult = builder.create<arith::MulIOp>(loc, size, parentPos);
|
||||
parentPos = builder.create<arith::AddIOp>(loc, mult, coordinates[l]);
|
||||
parentPos = builder.create<arith::AddIOp>(loc, mult, coords[l]);
|
||||
}
|
||||
}
|
||||
// Reached the actual value append/insert.
|
||||
@@ -846,7 +846,7 @@ public:
|
||||
// All initialization should be done on entry of the loop nest.
|
||||
rewriter.setInsertionPointAfter(op.getTensor().getDefiningOp());
|
||||
// Determine the size for access expansion (always the innermost stored
|
||||
// dimension size, translated back to original dimension). Note that we
|
||||
// level size, translated back to original dimension). Note that we
|
||||
// recursively rewrite the new DimOp on the **original** tensor.
|
||||
// FIXME: `toOrigDim` is deprecated.
|
||||
const Dimension innerDim = toOrigDim(srcType, srcType.getLvlRank() - 1);
|
||||
|
||||
Reference in New Issue
Block a user