@@ -70,7 +70,7 @@ class SparseTensorStorageBase {
70
70
// / Constructs a new sparse-tensor storage object with the given encoding.
71
71
SparseTensorStorageBase (uint64_t dimRank, const uint64_t *dimSizes,
72
72
uint64_t lvlRank, const uint64_t *lvlSizes,
73
- const DimLevelType *lvlTypes, const uint64_t *dim2lvl,
73
+ const LevelType *lvlTypes, const uint64_t *dim2lvl,
74
74
const uint64_t *lvl2dim);
75
75
virtual ~SparseTensorStorageBase () = default ;
76
76
@@ -99,10 +99,10 @@ class SparseTensorStorageBase {
99
99
}
100
100
101
101
// / Gets the level-types array.
102
- const std::vector<DimLevelType > &getLvlTypes () const { return lvlTypes; }
102
+ const std::vector<LevelType > &getLvlTypes () const { return lvlTypes; }
103
103
104
104
// / Safely looks up the type of the given level.
105
- DimLevelType getLvlType (uint64_t l) const {
105
+ LevelType getLvlType (uint64_t l) const {
106
106
assert (l < getLvlRank ());
107
107
return lvlTypes[l];
108
108
}
@@ -180,7 +180,7 @@ class SparseTensorStorageBase {
180
180
private:
181
181
const std::vector<uint64_t > dimSizes;
182
182
const std::vector<uint64_t > lvlSizes;
183
- const std::vector<DimLevelType > lvlTypes;
183
+ const std::vector<LevelType > lvlTypes;
184
184
const std::vector<uint64_t > dim2lvlVec;
185
185
const std::vector<uint64_t > lvl2dimVec;
186
186
@@ -203,7 +203,7 @@ class SparseTensorStorage final : public SparseTensorStorageBase {
203
203
// / doesn't entail `!(positions[l].empty())`.
204
204
SparseTensorStorage (uint64_t dimRank, const uint64_t *dimSizes,
205
205
uint64_t lvlRank, const uint64_t *lvlSizes,
206
- const DimLevelType *lvlTypes, const uint64_t *dim2lvl,
206
+ const LevelType *lvlTypes, const uint64_t *dim2lvl,
207
207
const uint64_t *lvl2dim)
208
208
: SparseTensorStorageBase(dimRank, dimSizes, lvlRank, lvlSizes, lvlTypes,
209
209
dim2lvl, lvl2dim),
@@ -219,7 +219,7 @@ class SparseTensorStorage final : public SparseTensorStorageBase {
219
219
// / some other form of initialization.
220
220
SparseTensorStorage (uint64_t dimRank, const uint64_t *dimSizes,
221
221
uint64_t lvlRank, const uint64_t *lvlSizes,
222
- const DimLevelType *lvlTypes, const uint64_t *dim2lvl,
222
+ const LevelType *lvlTypes, const uint64_t *dim2lvl,
223
223
const uint64_t *lvl2dim, SparseTensorCOO<V> *lvlCOO,
224
224
bool initializeValuesIfAllDense);
225
225
@@ -228,7 +228,7 @@ class SparseTensorStorage final : public SparseTensorStorageBase {
228
228
// / overhead-storage allocation as the ctor above.
229
229
SparseTensorStorage (uint64_t dimRank, const uint64_t *dimSizes,
230
230
uint64_t lvlRank, const uint64_t *lvlSizes,
231
- const DimLevelType *lvlTypes, const uint64_t *dim2lvl,
231
+ const LevelType *lvlTypes, const uint64_t *dim2lvl,
232
232
const uint64_t *lvl2dim, SparseTensorCOO<V> &lvlCOO);
233
233
234
234
// / Constructs a sparse tensor with the given encoding, and initializes
@@ -240,19 +240,19 @@ class SparseTensorStorage final : public SparseTensorStorageBase {
240
240
// / passed in as a single AoS memory.
241
241
SparseTensorStorage (uint64_t dimRank, const uint64_t *dimSizes,
242
242
uint64_t lvlRank, const uint64_t *lvlSizes,
243
- const DimLevelType *lvlTypes, const uint64_t *dim2lvl,
243
+ const LevelType *lvlTypes, const uint64_t *dim2lvl,
244
244
const uint64_t *lvl2dim, const intptr_t *lvlBufs);
245
245
246
246
// / Allocates a new empty sparse tensor.
247
247
static SparseTensorStorage<P, C, V> *
248
248
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,
250
250
const uint64_t *dim2lvl, const uint64_t *lvl2dim, bool forwarding);
251
251
252
252
// / Allocates a new sparse tensor and initializes it from the given COO.
253
253
static SparseTensorStorage<P, C, V> *
254
254
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,
256
256
const uint64_t *dim2lvl, const uint64_t *lvl2dim,
257
257
SparseTensorCOO<V> &lvlCOO);
258
258
@@ -261,7 +261,7 @@ class SparseTensorStorage final : public SparseTensorStorageBase {
261
261
static SparseTensorStorage<P, C, V> *
262
262
packFromLvlBuffers (uint64_t dimRank, const uint64_t *dimSizes,
263
263
uint64_t lvlRank, const uint64_t *lvlSizes,
264
- const DimLevelType *lvlTypes, const uint64_t *dim2lvl,
264
+ const LevelType *lvlTypes, const uint64_t *dim2lvl,
265
265
const uint64_t *lvl2dim, uint64_t srcRank,
266
266
const intptr_t *buffers);
267
267
@@ -294,7 +294,7 @@ class SparseTensorStorage final : public SparseTensorStorageBase {
294
294
void lexInsert (const uint64_t *lvlCoords, V val) final {
295
295
assert (lvlCoords);
296
296
bool allDense = std::all_of (getLvlTypes ().begin (), getLvlTypes ().end (),
297
- [](DimLevelType lt) { return isDenseLT (lt); });
297
+ [](LevelType lt) { return isDenseLT (lt); });
298
298
if (allDense) {
299
299
uint64_t lvlRank = getLvlRank ();
300
300
uint64_t valIdx = 0 ;
@@ -654,7 +654,7 @@ class SparseTensorStorage final : public SparseTensorStorageBase {
654
654
template <typename P, typename C, typename V>
655
655
SparseTensorStorage<P, C, V> *SparseTensorStorage<P, C, V>::newEmpty(
656
656
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,
658
658
const uint64_t *dim2lvl, const uint64_t *lvl2dim, bool forwarding) {
659
659
SparseTensorCOO<V> *lvlCOO = nullptr ;
660
660
if (forwarding)
@@ -667,7 +667,7 @@ SparseTensorStorage<P, C, V> *SparseTensorStorage<P, C, V>::newEmpty(
667
667
template <typename P, typename C, typename V>
668
668
SparseTensorStorage<P, C, V> *SparseTensorStorage<P, C, V>::newFromCOO(
669
669
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,
671
671
const uint64_t *dim2lvl, const uint64_t *lvl2dim,
672
672
SparseTensorCOO<V> &lvlCOO) {
673
673
return new SparseTensorStorage<P, C, V>(dimRank, dimSizes, lvlRank, lvlSizes,
@@ -677,7 +677,7 @@ SparseTensorStorage<P, C, V> *SparseTensorStorage<P, C, V>::newFromCOO(
677
677
template <typename P, typename C, typename V>
678
678
SparseTensorStorage<P, C, V> *SparseTensorStorage<P, C, V>::packFromLvlBuffers(
679
679
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,
681
681
const uint64_t *dim2lvl, const uint64_t *lvl2dim, uint64_t srcRank,
682
682
const intptr_t *buffers) {
683
683
return new SparseTensorStorage<P, C, V>(dimRank, dimSizes, lvlRank, lvlSizes,
@@ -693,7 +693,7 @@ SparseTensorStorage<P, C, V> *SparseTensorStorage<P, C, V>::packFromLvlBuffers(
693
693
template <typename P, typename C, typename V>
694
694
SparseTensorStorage<P, C, V>::SparseTensorStorage(
695
695
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,
697
697
const uint64_t *dim2lvl, const uint64_t *lvl2dim,
698
698
SparseTensorCOO<V> *lvlCOO, bool initializeValuesIfAllDense)
699
699
: SparseTensorStorage(dimRank, dimSizes, lvlRank, lvlSizes, lvlTypes,
@@ -742,7 +742,7 @@ SparseTensorStorage<P, C, V>::SparseTensorStorage(
742
742
template <typename P, typename C, typename V>
743
743
SparseTensorStorage<P, C, V>::SparseTensorStorage( // NOLINT
744
744
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,
746
746
const uint64_t *dim2lvl, const uint64_t *lvl2dim,
747
747
SparseTensorCOO<V> &lvlCOO)
748
748
: SparseTensorStorage(dimRank, dimSizes, lvlRank, lvlSizes, lvlTypes,
@@ -761,7 +761,7 @@ SparseTensorStorage<P, C, V>::SparseTensorStorage( // NOLINT
761
761
template <typename P, typename C, typename V>
762
762
SparseTensorStorage<P, C, V>::SparseTensorStorage(
763
763
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,
765
765
const uint64_t *dim2lvl, const uint64_t *lvl2dim, const intptr_t *lvlBufs)
766
766
: SparseTensorStorage(dimRank, dimSizes, lvlRank, lvlSizes, lvlTypes,
767
767
dim2lvl, lvl2dim) {
0 commit comments