infrt_phi_base.td 1.0 KB
Newer Older
1 2
#ifndef PHI_BASE
#define PHI_BASE
3 4

include "mlir/IR/OpBase.td"
5
include "paddle/infrt/dialect/infrt/ir/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
class PHI_Type<string type, list<Trait> traits = [], string baseCppClass = "::mlir::Type">
   : TypeDef<PHI_Dialect, type, !listconcat(traits, [PhiOpTrait, IsolatedFromAbove]), baseCppClass> {}
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38

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 41 42 43
def PD_DenseTensorMap : PHI_Type<"DenseTensorMap"> {
  let mnemonic = "dense_tensor_map";
}

44
#endif