[mlir][sparse] Implement parsing n out of m (#79935)
1. Add parsing methods for block[n, m]. 2. Encode n and m with the newly extended 64-bit LevelType enum. 3. Update 2:4 methods names/comments to n:m.
This commit is contained in:
@@ -130,7 +130,7 @@ static void allocSchemeForRank(OpBuilder &builder, Location loc,
|
||||
createPushback(builder, loc, desc, SparseTensorFieldKind::PosMemRef, lvl,
|
||||
/*value=*/posZero, /*repeat=*/linear);
|
||||
return;
|
||||
} else if (isSingletonLT(lt) || is2OutOf4LT(lt)) {
|
||||
} else if (isSingletonLT(lt) || isNOutOfMLT(lt)) {
|
||||
return; // nothing to do
|
||||
}
|
||||
// Keep compounding the size, but nothing needs to be initialized
|
||||
@@ -409,7 +409,7 @@ static void genEndInsert(OpBuilder &builder, Location loc,
|
||||
}
|
||||
} else {
|
||||
assert(isDenseLT(lt) || isLooseCompressedLT(lt) || isSingletonLT(lt) ||
|
||||
is2OutOf4LT(lt));
|
||||
isNOutOfMLT(lt));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -488,7 +488,7 @@ public:
|
||||
}
|
||||
parentPos =
|
||||
genCompressed(builder, loc, desc, coords, value, parentPos, lvl);
|
||||
} else if (isSingletonLT(lt) || is2OutOf4LT(lt)) {
|
||||
} else if (isSingletonLT(lt) || isNOutOfMLT(lt)) {
|
||||
// Create:
|
||||
// coordinates[lvl].push_back(coords[lvl])
|
||||
// positions[lvl] = positions[lvl-1]
|
||||
|
||||
Reference in New Issue
Block a user