Skip to content

Commit 2655039

Browse files
ensure 64 bits
1 parent fd2f19e commit 2655039

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
#include "mlir-c/AffineMap.h"
1414
#include "mlir-c/IR.h"
15+
#include <assert.h>
1516

1617
#ifdef __cplusplus
1718
extern "C" {
@@ -25,7 +26,11 @@ MLIR_DECLARE_CAPI_DIALECT_REGISTRATION(SparseTensor, sparse_tensor);
2526
/// These correspond to SparseTensorEncodingAttr::LevelType in the C++ API.
2627
/// If updating, keep them in sync and update the static_assert in the impl
2728
/// file.
28-
enum MlirSparseTensorLevelType {
29+
30+
#pragma GCC diagnostic push
31+
#pragma GCC diagnostic ignored "-Wfixed-enum-extension"
32+
33+
enum MlirSparseTensorLevelType : uint64_t {
2934
MLIR_SPARSE_TENSOR_LEVEL_DENSE = 0x000000010000,
3035
MLIR_SPARSE_TENSOR_LEVEL_COMPRESSED = 0x000000020000,
3136
MLIR_SPARSE_TENSOR_LEVEL_COMPRESSED_NU = 0x000000020001,
@@ -42,6 +47,11 @@ enum MlirSparseTensorLevelType {
4247
MLIR_SPARSE_TENSOR_LEVEL_N_OUT_OF_M = 0x000000100000,
4348
};
4449

50+
static_assert((sizeof(enum MlirSparseTensorLevelType) == 8),
51+
"MlirSparseTensorLevelType must be 8 bytes");
52+
53+
#pragma GCC diagnostic pop
54+
4555
//===----------------------------------------------------------------------===//
4656
// SparseTensorEncodingAttr
4757
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)