Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -495,13 +495,14 @@ FailureOr<PackResult> linalg::pack(RewriterBase &rewriter,
if (failed(maybePackedDimForEachOperand))
return failure();
packedOperandsDims.packedDimForEachOperand = *maybePackedDimForEachOperand;
listOfPackedOperandsDim.pushBack(std::move(packedOperandsDims));

LDBG() << "++++ After pack size #" << i << ": " << packedSizes[i];
LDBG() << "maps: " << llvm::interleaved(indexingMaps);
LDBG() << "iterators: " << llvm::interleaved(iteratorTypes);
LDBG() << "packedDimForEachOperand: "
<< llvm::interleaved(packedOperandsDims.packedDimForEachOperand);

listOfPackedOperandsDim.pushBack(std::move(packedOperandsDims));
}

// Step 2. Propagate packing to all LinalgOp operands.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,19 +152,20 @@ IterationGraphSorter IterationGraphSorter::fromGenericOp(
}

IterationGraphSorter::IterationGraphSorter(
SmallVector<Value> &&ins, SmallVector<AffineMap> &&loop2InsLvl, Value out,
AffineMap loop2OutLvl, SmallVector<utils::IteratorType> &&iterTypes,
SmallVector<Value> &&insArg, SmallVector<AffineMap> &&loop2InsLvlArg,
Value out, AffineMap loop2OutLvl,
SmallVector<utils::IteratorType> &&iterTypesArg,
sparse_tensor::LoopOrderingStrategy strategy)
: ins(std::move(ins)), loop2InsLvl(std::move(loop2InsLvl)), out(out),
loop2OutLvl(loop2OutLvl), iterTypes(std::move(iterTypes)),
: ins(std::move(insArg)), loop2InsLvl(std::move(loop2InsLvlArg)), out(out),
loop2OutLvl(loop2OutLvl), iterTypes(std::move(iterTypesArg)),
strategy(strategy) {
// One map per tensor.
assert(this->loop2InsLvl.size() == this->ins.size());
assert(loop2InsLvl.size() == ins.size());
// All the affine maps have the same number of dimensions (loops).
assert(llvm::all_equal(llvm::map_range(
this->loop2InsLvl, [](AffineMap m) { return m.getNumDims(); })));
loop2InsLvl, [](AffineMap m) { return m.getNumDims(); })));
// The number of results of the map should match the rank of the tensor.
assert(llvm::all_of(llvm::zip(this->loop2InsLvl, this->ins), [](auto mvPair) {
assert(llvm::all_of(llvm::zip(loop2InsLvl, ins), [](auto mvPair) {
auto [m, v] = mvPair;

// For ranked types the rank must match.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ class IterationGraphSorter {

private:
// Private constructor.
IterationGraphSorter(SmallVector<Value> &&ins,
SmallVector<AffineMap> &&loop2InsLvl, Value out,
IterationGraphSorter(SmallVector<Value> &&insArg,
SmallVector<AffineMap> &&loop2InsLvlArg, Value out,
AffineMap loop2OutLvl,
SmallVector<utils::IteratorType> &&iterTypes,
SmallVector<utils::IteratorType> &&iterTypesArg,
sparse_tensor::LoopOrderingStrategy strategy =
sparse_tensor::LoopOrderingStrategy::kDefault);

Expand Down