Skip to content

Commit 1944c4f

Browse files
authored
[mlir][sparse] rename DimLevelType to LevelType (#73561)
The "Dim" prefix is a legacy left-over that no longer makes sense, since we have a very strict "Dimension" vs. "Level" definition for sparse tensor types and their storage.
1 parent e1f69b8 commit 1944c4f

38 files changed

+494
-504
lines changed

mlir/include/mlir-c/Dialect/SparseTensor.h

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,24 @@ MLIR_DECLARE_CAPI_DIALECT_REGISTRATION(SparseTensor, sparse_tensor);
2222
/// Dimension level types (and properties) that define sparse tensors.
2323
/// See the documentation in SparseTensorAttrDefs.td for their meaning.
2424
///
25-
/// These correspond to SparseTensorEncodingAttr::DimLevelType in the C++ API.
25+
/// These correspond to SparseTensorEncodingAttr::LevelType in the C++ API.
2626
/// If updating, keep them in sync and update the static_assert in the impl
2727
/// file.
28-
enum MlirSparseTensorDimLevelType {
29-
MLIR_SPARSE_TENSOR_DIM_LEVEL_DENSE = 4, // 0b00001_00
30-
MLIR_SPARSE_TENSOR_DIM_LEVEL_COMPRESSED = 8, // 0b00010_00
31-
MLIR_SPARSE_TENSOR_DIM_LEVEL_COMPRESSED_NU = 9, // 0b00010_01
32-
MLIR_SPARSE_TENSOR_DIM_LEVEL_COMPRESSED_NO = 10, // 0b00010_10
33-
MLIR_SPARSE_TENSOR_DIM_LEVEL_COMPRESSED_NU_NO = 11, // 0b00010_11
34-
MLIR_SPARSE_TENSOR_DIM_LEVEL_SINGLETON = 16, // 0b00100_00
35-
MLIR_SPARSE_TENSOR_DIM_LEVEL_SINGLETON_NU = 17, // 0b00100_01
36-
MLIR_SPARSE_TENSOR_DIM_LEVEL_SINGLETON_NO = 18, // 0b00100_10
37-
MLIR_SPARSE_TENSOR_DIM_LEVEL_SINGLETON_NU_NO = 19, // 0b00100_11
38-
MLIR_SPARSE_TENSOR_DIM_LEVEL_LOOSE_COMPRESSED = 32, // 0b01000_00
39-
MLIR_SPARSE_TENSOR_DIM_LEVEL_LOOSE_COMPRESSED_NU = 33, // 0b01000_01
40-
MLIR_SPARSE_TENSOR_DIM_LEVEL_LOOSE_COMPRESSED_NO = 34, // 0b01000_10
41-
MLIR_SPARSE_TENSOR_DIM_LEVEL_LOOSE_COMPRESSED_NU_NO = 35, // 0b01000_11
42-
MLIR_SPARSE_TENSOR_DIM_LEVEL_TWO_OUT_OF_FOUR = 64, // 0b10000_00
28+
enum MlirSparseTensorLevelType {
29+
MLIR_SPARSE_TENSOR_LEVEL_DENSE = 4, // 0b00001_00
30+
MLIR_SPARSE_TENSOR_LEVEL_COMPRESSED = 8, // 0b00010_00
31+
MLIR_SPARSE_TENSOR_LEVEL_COMPRESSED_NU = 9, // 0b00010_01
32+
MLIR_SPARSE_TENSOR_LEVEL_COMPRESSED_NO = 10, // 0b00010_10
33+
MLIR_SPARSE_TENSOR_LEVEL_COMPRESSED_NU_NO = 11, // 0b00010_11
34+
MLIR_SPARSE_TENSOR_LEVEL_SINGLETON = 16, // 0b00100_00
35+
MLIR_SPARSE_TENSOR_LEVEL_SINGLETON_NU = 17, // 0b00100_01
36+
MLIR_SPARSE_TENSOR_LEVEL_SINGLETON_NO = 18, // 0b00100_10
37+
MLIR_SPARSE_TENSOR_LEVEL_SINGLETON_NU_NO = 19, // 0b00100_11
38+
MLIR_SPARSE_TENSOR_LEVEL_LOOSE_COMPRESSED = 32, // 0b01000_00
39+
MLIR_SPARSE_TENSOR_LEVEL_LOOSE_COMPRESSED_NU = 33, // 0b01000_01
40+
MLIR_SPARSE_TENSOR_LEVEL_LOOSE_COMPRESSED_NO = 34, // 0b01000_10
41+
MLIR_SPARSE_TENSOR_LEVEL_LOOSE_COMPRESSED_NU_NO = 35, // 0b01000_11
42+
MLIR_SPARSE_TENSOR_LEVEL_TWO_OUT_OF_FOUR = 64, // 0b10000_00
4343
};
4444

4545
//===----------------------------------------------------------------------===//
@@ -53,15 +53,15 @@ mlirAttributeIsASparseTensorEncodingAttr(MlirAttribute attr);
5353
/// Creates a `sparse_tensor.encoding` attribute with the given parameters.
5454
MLIR_CAPI_EXPORTED MlirAttribute mlirSparseTensorEncodingAttrGet(
5555
MlirContext ctx, intptr_t lvlRank,
56-
enum MlirSparseTensorDimLevelType const *lvlTypes, MlirAffineMap dimToLvl,
56+
enum MlirSparseTensorLevelType const *lvlTypes, MlirAffineMap dimToLvl,
5757
MlirAffineMap lvlTodim, int posWidth, int crdWidth);
5858

5959
/// Returns the level-rank of the `sparse_tensor.encoding` attribute.
6060
MLIR_CAPI_EXPORTED intptr_t
6161
mlirSparseTensorEncodingGetLvlRank(MlirAttribute attr);
6262

6363
/// Returns a specified level-type of the `sparse_tensor.encoding` attribute.
64-
MLIR_CAPI_EXPORTED enum MlirSparseTensorDimLevelType
64+
MLIR_CAPI_EXPORTED enum MlirSparseTensorLevelType
6565
mlirSparseTensorEncodingAttrGetLvlType(MlirAttribute attr, intptr_t lvl);
6666

6767
/// Returns the dimension-to-level mapping of the `sparse_tensor.encoding`

mlir/include/mlir/Dialect/SparseTensor/IR/Enums.h

Lines changed: 195 additions & 198 deletions
Large diffs are not rendered by default.

mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorAttrDefs.td

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ def SparseTensorEncodingAttr : SparseTensor_Attr<"SparseTensorEncoding",
278278
// A level-type for each level of the sparse storage
279279
// (consists of a level-format combined with level-properties).
280280
ArrayRefParameter<
281-
"::mlir::sparse_tensor::DimLevelType",
281+
"::mlir::sparse_tensor::LevelType",
282282
"level-types"
283283
>: $lvlTypes,
284284

@@ -302,7 +302,7 @@ def SparseTensorEncodingAttr : SparseTensor_Attr<"SparseTensorEncoding",
302302
);
303303

304304
let builders = [
305-
AttrBuilder<(ins "ArrayRef<::mlir::sparse_tensor::DimLevelType>":$lvlTypes,
305+
AttrBuilder<(ins "ArrayRef<::mlir::sparse_tensor::LevelType>":$lvlTypes,
306306
CArg<"AffineMap", "{}">:$dimToLvl,
307307
CArg<"AffineMap", "{}">:$lvlToDim,
308308
CArg<"unsigned", "0">:$posWidth,
@@ -366,9 +366,9 @@ def SparseTensorEncodingAttr : SparseTensor_Attr<"SparseTensorEncoding",
366366
//
367367

368368
/// Safely looks up the level-type for the requested level. (Returns
369-
/// `DimLevelType::Dense` for the null encoding, since dense-tensors
369+
/// `LevelType::Dense` for the null encoding, since dense-tensors
370370
/// are always all-dense.)
371-
::mlir::sparse_tensor::DimLevelType getLvlType(::mlir::sparse_tensor::Level l) const;
371+
::mlir::sparse_tensor::LevelType getLvlType(::mlir::sparse_tensor::Level l) const;
372372

373373
bool isDenseLvl(::mlir::sparse_tensor::Level l) const { return isDenseLT(getLvlType(l)); }
374374
bool isCompressedLvl(::mlir::sparse_tensor::Level l) const { return isCompressedLT(getLvlType(l)); }
@@ -428,7 +428,7 @@ def SparseTensorEncodingAttr : SparseTensor_Attr<"SparseTensorEncoding",
428428

429429
void printSymbols(AffineMap &map, AsmPrinter &printer) const;
430430
void printDimensions(AffineMap &map, AsmPrinter &printer, ArrayRef<::mlir::sparse_tensor::SparseTensorDimSliceAttr> dimSlices) const;
431-
void printLevels(AffineMap &map, AsmPrinter &printer, ArrayRef<::mlir::sparse_tensor::DimLevelType> lvlTypes) const;
431+
void printLevels(AffineMap &map, AsmPrinter &printer, ArrayRef<::mlir::sparse_tensor::LevelType> lvlTypes) const;
432432
}];
433433

434434
let genVerifyDecl = 1;

mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorStorageLayout.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class StorageLayout {
126126
void foreachField(
127127
llvm::function_ref<bool(
128128
FieldIndex /*fieldIdx*/, SparseTensorFieldKind /*fieldKind*/,
129-
Level /*lvl (if applicable)*/, DimLevelType /*LT (if applicable)*/)>)
129+
Level /*lvl (if applicable)*/, LevelType /*LT (if applicable)*/)>)
130130
const;
131131

132132
/// Gets the field index for required field.
@@ -165,15 +165,15 @@ inline unsigned getNumDataFieldsFromEncoding(SparseTensorEncodingAttr enc) {
165165
inline void foreachFieldInSparseTensor(
166166
SparseTensorEncodingAttr enc,
167167
llvm::function_ref<bool(FieldIndex, SparseTensorFieldKind, Level,
168-
DimLevelType)>
168+
LevelType)>
169169
callback) {
170170
return StorageLayout(enc).foreachField(callback);
171171
}
172172

173173
void foreachFieldAndTypeInSparseTensor(
174174
SparseTensorType,
175175
llvm::function_ref<bool(Type, FieldIndex, SparseTensorFieldKind, Level,
176-
DimLevelType)>);
176+
LevelType)>);
177177

178178
} // namespace sparse_tensor
179179
} // namespace mlir

mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorType.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,8 @@ class SparseTensorType {
282282
/// `ShapedType::Trait<T>::getNumDynamicDims`.
283283
int64_t getNumDynamicDims() const { return rtp.getNumDynamicDims(); }
284284

285-
ArrayRef<DimLevelType> getLvlTypes() const { return enc.getLvlTypes(); }
286-
DimLevelType getLvlType(Level l) const {
285+
ArrayRef<LevelType> getLvlTypes() const { return enc.getLvlTypes(); }
286+
LevelType getLvlType(Level l) const {
287287
// This OOB check is for dense-tensors, since this class knows
288288
// their lvlRank (whereas STEA::getLvlType will/can only check
289289
// OOB for sparse-tensors).

mlir/include/mlir/Dialect/SparseTensor/Utils/Merger.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ using LatPointId = unsigned;
5656
/// for the corresponding `SmallVector<LatPointId>` object.
5757
using LatSetId = unsigned;
5858

59-
/// A pair of level and its corresponding DimLevelType of a tensor.
60-
using LvlLTPair = std::pair<Level, DimLevelType>;
59+
/// A pair of level and its corresponding LevelType of a tensor.
60+
using LvlLTPair = std::pair<Level, LevelType>;
6161

6262
/// A pair of loop id and its coefficients. E.g., for affine expression in the
6363
/// affine map `2 * d0`, loop id = 0, coefficient = 2.
@@ -395,13 +395,13 @@ class Merger {
395395
bool hasSparseIdxReduction(const BitVector &bits) const;
396396

397397
/// Gets the level-type of the `t`th tensor on `i`th loop.
398-
DimLevelType getLvlType(TensorId t, LoopId i) const {
398+
LevelType getLvlType(TensorId t, LoopId i) const {
399399
assert(isValidTensorId(t) && isValidLoopId(i));
400400
return lvlTypes[t][i];
401401
}
402402

403403
/// Gets the level-type of the TensorLoopId.
404-
DimLevelType getLvlType(TensorLoopId b) const {
404+
LevelType getLvlType(TensorLoopId b) const {
405405
return getLvlType(tensor(b), loop(b));
406406
}
407407

@@ -422,7 +422,7 @@ class Merger {
422422

423423
/// Sets the level number and level-type of the `t`th tensor on
424424
/// `i`th loop.
425-
void setLevelAndType(TensorId t, LoopId i, Level lvl, DimLevelType lt) {
425+
void setLevelAndType(TensorId t, LoopId i, Level lvl, LevelType lt) {
426426
assert(isValidLevel(t, lvl) && isValidLoopId(i) && isValidLT(lt));
427427
lvlTypes[t][i] = lt;
428428
loopToLvl[t][i] = lvl;
@@ -432,7 +432,7 @@ class Merger {
432432
}
433433

434434
using ForeachTensorLoopIdCallback = function_ref<void(
435-
TensorLoopId, TensorId, std::optional<Level>, DimLevelType, bool)>;
435+
TensorLoopId, TensorId, std::optional<Level>, LevelType, bool)>;
436436

437437
/// Iterates over a set of `TensorLoopId`s, invoking the callback
438438
/// for each `TensorLoopId` and passing it the corresponding tensor
@@ -469,7 +469,7 @@ class Merger {
469469

470470
/// Establishes the two-way map that i <-> <t, lvl, lt>.
471471
void setLoopDependentTensorLevel(LoopId i, TensorId t, Level lvl,
472-
DimLevelType lt, unsigned coefficient) {
472+
LevelType lt, unsigned coefficient) {
473473
assert(isValidLoopId(i) && isValidLevel(t, lvl));
474474
assert(!loopToUnresolvedLvls[i][t].has_value()); // must be the first def
475475
loopToUnresolvedLvls[i][t] = std::make_pair(lvl, lt);
@@ -520,7 +520,7 @@ class Merger {
520520
return loopToUnresolvedLvls[loop(b)][tensor(b)]->first;
521521
}
522522

523-
DimLevelType getLoopDependentLevelType(TensorLoopId b) const {
523+
LevelType getLoopDependentLevelType(TensorLoopId b) const {
524524
assert(isLvlWithNonTrivialIdxExp(b));
525525
return loopToUnresolvedLvls[loop(b)][tensor(b)]->second;
526526
}
@@ -636,7 +636,7 @@ class Merger {
636636
// does not.
637637

638638
/// Map that converts pair<TensorId, LoopId> to the corresponding lvl-type.
639-
std::vector<std::vector<DimLevelType>> lvlTypes;
639+
std::vector<std::vector<LevelType>> lvlTypes;
640640

641641
/// Map that converts pair<TensorId, LoopId> to the corresponding lvl.
642642
std::vector<std::vector<std::optional<Level>>> loopToLvl;

mlir/include/mlir/ExecutionEngine/SparseTensor/File.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ class SparseTensorReader final {
197197
template <typename P, typename I, typename V>
198198
SparseTensorStorage<P, I, V> *
199199
readSparseTensor(uint64_t lvlRank, const uint64_t *lvlSizes,
200-
const DimLevelType *lvlTypes, const uint64_t *dim2lvl,
200+
const LevelType *lvlTypes, const uint64_t *dim2lvl,
201201
const uint64_t *lvl2dim) {
202202
const uint64_t dimRank = getRank();
203203
MapRef map(dimRank, lvlRank, dim2lvl, lvl2dim);

mlir/include/mlir/ExecutionEngine/SparseTensor/Storage.h

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class SparseTensorStorageBase {
7070
/// Constructs a new sparse-tensor storage object with the given encoding.
7171
SparseTensorStorageBase(uint64_t dimRank, const uint64_t *dimSizes,
7272
uint64_t lvlRank, const uint64_t *lvlSizes,
73-
const DimLevelType *lvlTypes, const uint64_t *dim2lvl,
73+
const LevelType *lvlTypes, const uint64_t *dim2lvl,
7474
const uint64_t *lvl2dim);
7575
virtual ~SparseTensorStorageBase() = default;
7676

@@ -99,10 +99,10 @@ class SparseTensorStorageBase {
9999
}
100100

101101
/// Gets the level-types array.
102-
const std::vector<DimLevelType> &getLvlTypes() const { return lvlTypes; }
102+
const std::vector<LevelType> &getLvlTypes() const { return lvlTypes; }
103103

104104
/// Safely looks up the type of the given level.
105-
DimLevelType getLvlType(uint64_t l) const {
105+
LevelType getLvlType(uint64_t l) const {
106106
assert(l < getLvlRank());
107107
return lvlTypes[l];
108108
}
@@ -180,7 +180,7 @@ class SparseTensorStorageBase {
180180
private:
181181
const std::vector<uint64_t> dimSizes;
182182
const std::vector<uint64_t> lvlSizes;
183-
const std::vector<DimLevelType> lvlTypes;
183+
const std::vector<LevelType> lvlTypes;
184184
const std::vector<uint64_t> dim2lvlVec;
185185
const std::vector<uint64_t> lvl2dimVec;
186186

@@ -203,7 +203,7 @@ class SparseTensorStorage final : public SparseTensorStorageBase {
203203
/// doesn't entail `!(positions[l].empty())`.
204204
SparseTensorStorage(uint64_t dimRank, const uint64_t *dimSizes,
205205
uint64_t lvlRank, const uint64_t *lvlSizes,
206-
const DimLevelType *lvlTypes, const uint64_t *dim2lvl,
206+
const LevelType *lvlTypes, const uint64_t *dim2lvl,
207207
const uint64_t *lvl2dim)
208208
: SparseTensorStorageBase(dimRank, dimSizes, lvlRank, lvlSizes, lvlTypes,
209209
dim2lvl, lvl2dim),
@@ -219,7 +219,7 @@ class SparseTensorStorage final : public SparseTensorStorageBase {
219219
/// some other form of initialization.
220220
SparseTensorStorage(uint64_t dimRank, const uint64_t *dimSizes,
221221
uint64_t lvlRank, const uint64_t *lvlSizes,
222-
const DimLevelType *lvlTypes, const uint64_t *dim2lvl,
222+
const LevelType *lvlTypes, const uint64_t *dim2lvl,
223223
const uint64_t *lvl2dim, SparseTensorCOO<V> *lvlCOO,
224224
bool initializeValuesIfAllDense);
225225

@@ -228,7 +228,7 @@ class SparseTensorStorage final : public SparseTensorStorageBase {
228228
/// overhead-storage allocation as the ctor above.
229229
SparseTensorStorage(uint64_t dimRank, const uint64_t *dimSizes,
230230
uint64_t lvlRank, const uint64_t *lvlSizes,
231-
const DimLevelType *lvlTypes, const uint64_t *dim2lvl,
231+
const LevelType *lvlTypes, const uint64_t *dim2lvl,
232232
const uint64_t *lvl2dim, SparseTensorCOO<V> &lvlCOO);
233233

234234
/// Constructs a sparse tensor with the given encoding, and initializes
@@ -240,19 +240,19 @@ class SparseTensorStorage final : public SparseTensorStorageBase {
240240
/// passed in as a single AoS memory.
241241
SparseTensorStorage(uint64_t dimRank, const uint64_t *dimSizes,
242242
uint64_t lvlRank, const uint64_t *lvlSizes,
243-
const DimLevelType *lvlTypes, const uint64_t *dim2lvl,
243+
const LevelType *lvlTypes, const uint64_t *dim2lvl,
244244
const uint64_t *lvl2dim, const intptr_t *lvlBufs);
245245

246246
/// Allocates a new empty sparse tensor.
247247
static SparseTensorStorage<P, C, V> *
248248
newEmpty(uint64_t dimRank, const uint64_t *dimSizes, uint64_t lvlRank,
249-
const uint64_t *lvlSizes, const DimLevelType *lvlTypes,
249+
const uint64_t *lvlSizes, const LevelType *lvlTypes,
250250
const uint64_t *dim2lvl, const uint64_t *lvl2dim, bool forwarding);
251251

252252
/// Allocates a new sparse tensor and initializes it from the given COO.
253253
static SparseTensorStorage<P, C, V> *
254254
newFromCOO(uint64_t dimRank, const uint64_t *dimSizes, uint64_t lvlRank,
255-
const uint64_t *lvlSizes, const DimLevelType *lvlTypes,
255+
const uint64_t *lvlSizes, const LevelType *lvlTypes,
256256
const uint64_t *dim2lvl, const uint64_t *lvl2dim,
257257
SparseTensorCOO<V> &lvlCOO);
258258

@@ -261,7 +261,7 @@ class SparseTensorStorage final : public SparseTensorStorageBase {
261261
static SparseTensorStorage<P, C, V> *
262262
packFromLvlBuffers(uint64_t dimRank, const uint64_t *dimSizes,
263263
uint64_t lvlRank, const uint64_t *lvlSizes,
264-
const DimLevelType *lvlTypes, const uint64_t *dim2lvl,
264+
const LevelType *lvlTypes, const uint64_t *dim2lvl,
265265
const uint64_t *lvl2dim, uint64_t srcRank,
266266
const intptr_t *buffers);
267267

@@ -294,7 +294,7 @@ class SparseTensorStorage final : public SparseTensorStorageBase {
294294
void lexInsert(const uint64_t *lvlCoords, V val) final {
295295
assert(lvlCoords);
296296
bool allDense = std::all_of(getLvlTypes().begin(), getLvlTypes().end(),
297-
[](DimLevelType lt) { return isDenseLT(lt); });
297+
[](LevelType lt) { return isDenseLT(lt); });
298298
if (allDense) {
299299
uint64_t lvlRank = getLvlRank();
300300
uint64_t valIdx = 0;
@@ -654,7 +654,7 @@ class SparseTensorStorage final : public SparseTensorStorageBase {
654654
template <typename P, typename C, typename V>
655655
SparseTensorStorage<P, C, V> *SparseTensorStorage<P, C, V>::newEmpty(
656656
uint64_t dimRank, const uint64_t *dimSizes, uint64_t lvlRank,
657-
const uint64_t *lvlSizes, const DimLevelType *lvlTypes,
657+
const uint64_t *lvlSizes, const LevelType *lvlTypes,
658658
const uint64_t *dim2lvl, const uint64_t *lvl2dim, bool forwarding) {
659659
SparseTensorCOO<V> *lvlCOO = nullptr;
660660
if (forwarding)
@@ -667,7 +667,7 @@ SparseTensorStorage<P, C, V> *SparseTensorStorage<P, C, V>::newEmpty(
667667
template <typename P, typename C, typename V>
668668
SparseTensorStorage<P, C, V> *SparseTensorStorage<P, C, V>::newFromCOO(
669669
uint64_t dimRank, const uint64_t *dimSizes, uint64_t lvlRank,
670-
const uint64_t *lvlSizes, const DimLevelType *lvlTypes,
670+
const uint64_t *lvlSizes, const LevelType *lvlTypes,
671671
const uint64_t *dim2lvl, const uint64_t *lvl2dim,
672672
SparseTensorCOO<V> &lvlCOO) {
673673
return new SparseTensorStorage<P, C, V>(dimRank, dimSizes, lvlRank, lvlSizes,
@@ -677,7 +677,7 @@ SparseTensorStorage<P, C, V> *SparseTensorStorage<P, C, V>::newFromCOO(
677677
template <typename P, typename C, typename V>
678678
SparseTensorStorage<P, C, V> *SparseTensorStorage<P, C, V>::packFromLvlBuffers(
679679
uint64_t dimRank, const uint64_t *dimSizes, uint64_t lvlRank,
680-
const uint64_t *lvlSizes, const DimLevelType *lvlTypes,
680+
const uint64_t *lvlSizes, const LevelType *lvlTypes,
681681
const uint64_t *dim2lvl, const uint64_t *lvl2dim, uint64_t srcRank,
682682
const intptr_t *buffers) {
683683
return new SparseTensorStorage<P, C, V>(dimRank, dimSizes, lvlRank, lvlSizes,
@@ -693,7 +693,7 @@ SparseTensorStorage<P, C, V> *SparseTensorStorage<P, C, V>::packFromLvlBuffers(
693693
template <typename P, typename C, typename V>
694694
SparseTensorStorage<P, C, V>::SparseTensorStorage(
695695
uint64_t dimRank, const uint64_t *dimSizes, uint64_t lvlRank,
696-
const uint64_t *lvlSizes, const DimLevelType *lvlTypes,
696+
const uint64_t *lvlSizes, const LevelType *lvlTypes,
697697
const uint64_t *dim2lvl, const uint64_t *lvl2dim,
698698
SparseTensorCOO<V> *lvlCOO, bool initializeValuesIfAllDense)
699699
: SparseTensorStorage(dimRank, dimSizes, lvlRank, lvlSizes, lvlTypes,
@@ -742,7 +742,7 @@ SparseTensorStorage<P, C, V>::SparseTensorStorage(
742742
template <typename P, typename C, typename V>
743743
SparseTensorStorage<P, C, V>::SparseTensorStorage( // NOLINT
744744
uint64_t dimRank, const uint64_t *dimSizes, uint64_t lvlRank,
745-
const uint64_t *lvlSizes, const DimLevelType *lvlTypes,
745+
const uint64_t *lvlSizes, const LevelType *lvlTypes,
746746
const uint64_t *dim2lvl, const uint64_t *lvl2dim,
747747
SparseTensorCOO<V> &lvlCOO)
748748
: SparseTensorStorage(dimRank, dimSizes, lvlRank, lvlSizes, lvlTypes,
@@ -761,7 +761,7 @@ SparseTensorStorage<P, C, V>::SparseTensorStorage( // NOLINT
761761
template <typename P, typename C, typename V>
762762
SparseTensorStorage<P, C, V>::SparseTensorStorage(
763763
uint64_t dimRank, const uint64_t *dimSizes, uint64_t lvlRank,
764-
const uint64_t *lvlSizes, const DimLevelType *lvlTypes,
764+
const uint64_t *lvlSizes, const LevelType *lvlTypes,
765765
const uint64_t *dim2lvl, const uint64_t *lvl2dim, const intptr_t *lvlBufs)
766766
: SparseTensorStorage(dimRank, dimSizes, lvlRank, lvlSizes, lvlTypes,
767767
dim2lvl, lvl2dim) {

mlir/include/mlir/ExecutionEngine/SparseTensorRuntime.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ extern "C" {
5252
MLIR_CRUNNERUTILS_EXPORT void *_mlir_ciface_newSparseTensor( // NOLINT
5353
StridedMemRefType<index_type, 1> *dimSizesRef,
5454
StridedMemRefType<index_type, 1> *lvlSizesRef,
55-
StridedMemRefType<DimLevelType, 1> *lvlTypesRef,
55+
StridedMemRefType<LevelType, 1> *lvlTypesRef,
5656
StridedMemRefType<index_type, 1> *dim2lvlRef,
5757
StridedMemRefType<index_type, 1> *lvl2dimRef, OverheadType posTp,
5858
OverheadType crdTp, PrimaryType valTp, Action action, void *ptr);

0 commit comments

Comments
 (0)