[Mlir-commits] [mlir] [mlir][sparse] Introduce batch level format. (PR #83082)
Yinying Li
llvmlistbot at llvm.org
Mon Feb 26 16:02:12 PST 2024
================
@@ -154,12 +154,26 @@ enum class Action : uint32_t {
enum class LevelFormat : uint64_t {
Undef = 0x00000000,
Dense = 0x00010000,
- Compressed = 0x00020000,
- Singleton = 0x00040000,
- LooseCompressed = 0x00080000,
- NOutOfM = 0x00100000,
+ Batch = 0x00020000,
+ Compressed = 0x00040000,
+ Singleton = 0x00080000,
+ LooseCompressed = 0x00100000,
+ NOutOfM = 0x00200000,
};
+constexpr bool encPowOfTwo(LevelFormat fmt) {
+ auto enc = static_cast<std::underlying_type_t<LevelFormat>>(fmt);
+ return (enc & (enc - 1)) == 0;
+}
+
+// All LevelFormat must have only one bit set (power of two).
----------------
yinying-lisa-li wrote:
nit: maybe LevelFormats?
https://github.com/llvm/llvm-project/pull/83082
More information about the Mlir-commits
mailing list