infrt_phi_base.td 883 字节
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
include "mlir/Interfaces/InferTypeOpInterface.td"
7

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

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

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

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

21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
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 `>`";
 }
39 40

#endif