@@ -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//===----------------------------------------------------------------------===//
@@ -565,6 +563,34 @@ L(T) = [ {0,8} , {1,9} , {2,10}, {3,11}, {0,8} , {1, 9} , {2, 10}, {3, 11},
565563 }];
566564}
567565
566+ //===----------------------------------------------------------------------===//
567+ // Linear Layout Encoding
568+ //===----------------------------------------------------------------------===//
569+
570+ def LinearEncodingAttr : DistributedEncoding<"LinearEncoding", "linear_encoding"> {
571+ let mnemonic = "linear";
572+
573+ let description = [{
574+ See the docs in LinearLayout.h for the definition of linear layouts.
575+ }];
576+
577+ let parameters = (ins "LinearLayout":$linearLayout);
578+
579+ let extraClassDeclaration = extraDistributedDeclaration # [{
580+ SmallVector<unsigned> getContigPerThread() const;
581+ SmallVector<unsigned> getOrder() const;
582+ }];
583+
584+ let genVerifyDecl = 1;
585+ // Example of assembly format:
586+ // <{register = [[0, 1], [8, 0], [0, 8], [64, 0]],
587+ // lane = [[0, 2], [0, 4], [1, 0], [2, 0], [4, 0]],
588+ // warp = [[16, 0], [32, 0]],
589+ // block = []}>
590+ let hasCustomAssemblyFormat = 1;
591+ }
592+
593+
568594//===----------------------------------------------------------------------===//
569595// Blocked Layout Encoding
570596//===----------------------------------------------------------------------===//
0 commit comments