Changeset View
Changeset View
Standalone View
Standalone View
mlir/lib/ExecutionEngine/SparseTensor/NNZ.cpp
Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | case DimLevelType::kDense: | ||||
break; | break; | ||||
case DimLevelType::kSingleton: | case DimLevelType::kSingleton: | ||||
// Singleton after Compressed causes no problems for allocating | // Singleton after Compressed causes no problems for allocating | ||||
// `nnz` nor for the yieldPos loop. This remains true even | // `nnz` nor for the yieldPos loop. This remains true even | ||||
// when adding support for multiple compressed dimensions or | // when adding support for multiple compressed dimensions or | ||||
// for dense-after-compressed. | // for dense-after-compressed. | ||||
break; | break; | ||||
default: | default: | ||||
MLIR_SPARSETENSOR_FATAL("unsupported dimension level type"); | MLIR_SPARSETENSOR_FATAL("unsupported dimension level type: %d\n", | ||||
static_cast<uint8_t>(dimTypes[r])); | |||||
} | } | ||||
sz = detail::checkedMul(sz, dimSizes[r]); | sz = detail::checkedMul(sz, dimSizes[r]); | ||||
} | } | ||||
} | } | ||||
/// Lexicographically enumerates all indicies for dimensions strictly | /// Lexicographically enumerates all indicies for dimensions strictly | ||||
/// less than `stopDim`, and passes their nnz statistic to the callback. | /// less than `stopDim`, and passes their nnz statistic to the callback. | ||||
/// Since our use-case only requires the statistic not the coordinates | /// Since our use-case only requires the statistic not the coordinates | ||||
Show All 38 Lines |