@@ -56,7 +56,6 @@ Right now, Triton implements two main classes of layouts: shared, and distribute
5656 code extraBaseClassDeclaration = [{
5757 unsigned getTotalElemsPerThread(ArrayRef<int64_t> shape, Type eltTy) const;
5858 SmallVector<unsigned> getElemsPerThread(ArrayRef<int64_t> shape, Type eltTy) const;
59- ::mlir::LogicalResult verifyLayoutForArg(::mlir::Operation* op, unsigned argNo) const;
6059 }];
6160}
6261
@@ -147,7 +146,6 @@ addition, if there's only one CTA per CGA, then Triton canonicalizes CTAOrder to
147146 let genVerifyDecl = 1;
148147 let skipDefaultBuilders = 1;
149148}
150-
151149//===----------------------------------------------------------------------===//
152150// Shared Layout Encoding
153151//===----------------------------------------------------------------------===//
@@ -571,6 +569,34 @@ L(T) = [ {0,8} , {1,9} , {2,10}, {3,11}, {0,8} , {1, 9} , {2, 10}, {3, 11},
571569 }];
572570}
573571
572+ //===----------------------------------------------------------------------===//
573+ // Linear Layout Encoding
574+ //===----------------------------------------------------------------------===//
575+
576+ def LinearEncodingAttr : DistributedEncoding<"LinearEncoding", "linear_encoding"> {
577+ let mnemonic = "linear";
578+
579+ let description = [{
580+ See the docs in LinearLayout.h for the definition of linear layouts.
581+ }];
582+
583+ let parameters = (ins "LinearLayout":$linearLayout);
584+
585+ let extraClassDeclaration = extraDistributedDeclaration # [{
586+ SmallVector<unsigned> getContigPerThread() const;
587+ SmallVector<unsigned> getOrder() const;
588+ }];
589+
590+ let genVerifyDecl = 1;
591+ // Example of assembly format:
592+ // <{register = [[0, 1], [8, 0], [0, 8], [64, 0]],
593+ // lane = [[0, 2], [0, 4], [1, 0], [2, 0], [4, 0]],
594+ // warp = [[16, 0], [32, 0]],
595+ // block = []}>
596+ let hasCustomAssemblyFormat = 1;
597+ }
598+
599+
574600//===----------------------------------------------------------------------===//
575601// Blocked Layout Encoding
576602//===----------------------------------------------------------------------===//
0 commit comments