diff options
Diffstat (limited to 'mlir/include/mlir-c/Dialect')
-rw-r--r-- | mlir/include/mlir-c/Dialect/SparseTensor.h | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/mlir/include/mlir-c/Dialect/SparseTensor.h b/mlir/include/mlir-c/Dialect/SparseTensor.h index 42d8400..d549f5d 100644 --- a/mlir/include/mlir-c/Dialect/SparseTensor.h +++ b/mlir/include/mlir-c/Dialect/SparseTensor.h @@ -28,20 +28,20 @@ MLIR_DECLARE_CAPI_DIALECT_REGISTRATION(SparseTensor, sparse_tensor); typedef uint64_t MlirSparseTensorLevelType; enum MlirBaseSparseTensorLevelType { - MLIR_SPARSE_TENSOR_LEVEL_DENSE = 4, // 0b00001_00 - MLIR_SPARSE_TENSOR_LEVEL_COMPRESSED = 8, // 0b00010_00 - MLIR_SPARSE_TENSOR_LEVEL_COMPRESSED_NU = 9, // 0b00010_01 - MLIR_SPARSE_TENSOR_LEVEL_COMPRESSED_NO = 10, // 0b00010_10 - MLIR_SPARSE_TENSOR_LEVEL_COMPRESSED_NU_NO = 11, // 0b00010_11 - MLIR_SPARSE_TENSOR_LEVEL_SINGLETON = 16, // 0b00100_00 - MLIR_SPARSE_TENSOR_LEVEL_SINGLETON_NU = 17, // 0b00100_01 - MLIR_SPARSE_TENSOR_LEVEL_SINGLETON_NO = 18, // 0b00100_10 - MLIR_SPARSE_TENSOR_LEVEL_SINGLETON_NU_NO = 19, // 0b00100_11 - MLIR_SPARSE_TENSOR_LEVEL_LOOSE_COMPRESSED = 32, // 0b01000_00 - MLIR_SPARSE_TENSOR_LEVEL_LOOSE_COMPRESSED_NU = 33, // 0b01000_01 - MLIR_SPARSE_TENSOR_LEVEL_LOOSE_COMPRESSED_NO = 34, // 0b01000_10 - MLIR_SPARSE_TENSOR_LEVEL_LOOSE_COMPRESSED_NU_NO = 35, // 0b01000_11 - MLIR_SPARSE_TENSOR_LEVEL_TWO_OUT_OF_FOUR = 64, // 0b10000_00 + MLIR_SPARSE_TENSOR_LEVEL_DENSE = 0x000000010000, + MLIR_SPARSE_TENSOR_LEVEL_COMPRESSED = 0x000000020000, + MLIR_SPARSE_TENSOR_LEVEL_COMPRESSED_NU = 0x000000020001, + MLIR_SPARSE_TENSOR_LEVEL_COMPRESSED_NO = 0x000000020002, + MLIR_SPARSE_TENSOR_LEVEL_COMPRESSED_NU_NO = 0x000000020003, + MLIR_SPARSE_TENSOR_LEVEL_SINGLETON = 0x000000040000, + MLIR_SPARSE_TENSOR_LEVEL_SINGLETON_NU = 0x000000040001, + MLIR_SPARSE_TENSOR_LEVEL_SINGLETON_NO = 0x000000040002, + MLIR_SPARSE_TENSOR_LEVEL_SINGLETON_NU_NO = 0x000000040003, + MLIR_SPARSE_TENSOR_LEVEL_LOOSE_COMPRESSED = 0x000000080000, + MLIR_SPARSE_TENSOR_LEVEL_LOOSE_COMPRESSED_NU = 0x000000080001, + MLIR_SPARSE_TENSOR_LEVEL_LOOSE_COMPRESSED_NO = 0x000000080002, + MLIR_SPARSE_TENSOR_LEVEL_LOOSE_COMPRESSED_NU_NO = 0x000000080003, + MLIR_SPARSE_TENSOR_LEVEL_N_OUT_OF_M = 0x000000100000, }; //===----------------------------------------------------------------------===// @@ -84,6 +84,16 @@ mlirSparseTensorEncodingAttrGetPosWidth(MlirAttribute attr); MLIR_CAPI_EXPORTED int mlirSparseTensorEncodingAttrGetCrdWidth(MlirAttribute attr); +MLIR_CAPI_EXPORTED unsigned +mlirSparseTensorEncodingAttrGetStructuredN(MlirSparseTensorLevelType lvlType); + +MLIR_CAPI_EXPORTED unsigned +mlirSparseTensorEncodingAttrGetStructuredM(MlirSparseTensorLevelType lvlType); + +MLIR_CAPI_EXPORTED MlirSparseTensorLevelType +mlirSparseTensorEncodingAttrBuildLvlType( + enum MlirBaseSparseTensorLevelType lvlType, unsigned n, unsigned m); + #ifdef __cplusplus } #endif |