infrt_phi_base.td 833 字节
Newer Older
1 2
#ifndef PHI_BASE
#define PHI_BASE
3 4

include "mlir/IR/OpBase.td"
5
include "paddle/infrt/dialect/infrt_base.td"
6

7 8
def PHI_Dialect : Dialect {
  let name = "phi";
9 10

  let description = [{
11
    The PHI host dialect.
12 13
  }];

14
  let cppNamespace = "::infrt::phi";
15
  let useDefaultTypePrinterParser = 1;
16 17
}

18 19
def PhiOpTrait : NativeOpTrait<"PhiOpTrait">;

20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
class PHI_Type<string type, list<Trait> traits = []>
   : TypeDef<PHI_Dialect, type, !listconcat(traits, [PhiOpTrait, IsolatedFromAbove])> {}

def Allocator : PHI_Type<"Allocator"> {
   let mnemonic = "allocator";
   let parameters = (ins
     TargetParam:$target
   );
   let assemblyFormat = "`<` $target `>`";
 }

 def Context : PHI_Type<"Context"> {
   let mnemonic = "context";
   let parameters = (ins
     TargetParam:$target
   );
   let assemblyFormat = "`<` $target `>`";
 }
38 39

#endif