Skip to content

Commit cff40fa

Browse files
n:m without enum64 changes
1 parent 7273615 commit cff40fa

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

mlir/lib/Bindings/Python/DialectSparseTensor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ static void populateDialectSparseTensorSubmodule(const py::module &m) {
4646
mlirAttributeIsASparseTensorEncodingAttr)
4747
.def_classmethod(
4848
"get",
49-
[](py::object cls, std::vector<level_type> lvlTypes,
49+
[](py::object cls, std::vector<MlirSparseTensorLevelType> lvlTypes,
5050
std::optional<MlirAffineMap> dimToLvl,
5151
std::optional<MlirAffineMap> lvlToDim, int posWidth, int crdWidth,
5252
MlirContext context) {
@@ -64,7 +64,7 @@ static void populateDialectSparseTensorSubmodule(const py::module &m) {
6464
"lvl_types",
6565
[](MlirAttribute self) {
6666
const int lvlRank = mlirSparseTensorEncodingGetLvlRank(self);
67-
std::vector<level_type> ret;
67+
std::vector<MlirSparseTensorLevelType> ret;
6868
ret.reserve(lvlRank);
6969
for (int l = 0; l < lvlRank; ++l)
7070
ret.push_back(mlirSparseTensorEncodingAttrGetLvlType(self, l));

mlir/lib/CAPI/Dialect/SparseTensor.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ bool mlirAttributeIsASparseTensorEncodingAttr(MlirAttribute attr) {
5555
return isa<SparseTensorEncodingAttr>(unwrap(attr));
5656
}
5757

58-
MlirAttribute mlirSparseTensorEncodingAttrGet(MlirContext ctx, intptr_t lvlRank,
59-
level_type const *lvlTypes,
60-
MlirAffineMap dimToLvl,
61-
MlirAffineMap lvlToDim,
62-
int posWidth, int crdWidth) {
58+
MlirAttribute
59+
mlirSparseTensorEncodingAttrGet(MlirContext ctx, intptr_t lvlRank,
60+
MlirSparseTensorLevelType const *lvlTypes,
61+
MlirAffineMap dimToLvl, MlirAffineMap lvlToDim,
62+
int posWidth, int crdWidth) {
6363
SmallVector<LevelType> cppLvlTypes;
6464
cppLvlTypes.reserve(lvlRank);
6565
for (intptr_t l = 0; l < lvlRank; ++l)
@@ -81,9 +81,9 @@ intptr_t mlirSparseTensorEncodingGetLvlRank(MlirAttribute attr) {
8181
return cast<SparseTensorEncodingAttr>(unwrap(attr)).getLvlRank();
8282
}
8383

84-
level_type mlirSparseTensorEncodingAttrGetLvlType(MlirAttribute attr,
85-
intptr_t lvl) {
86-
return static_cast<level_type>(
84+
MlirSparseTensorLevelType
85+
mlirSparseTensorEncodingAttrGetLvlType(MlirAttribute attr, intptr_t lvl) {
86+
return static_cast<MlirSparseTensorLevelType>(
8787
cast<SparseTensorEncodingAttr>(unwrap(attr)).getLvlType(lvl));
8888
}
8989

0 commit comments

Comments
 (0)