infrt_phi_kernel.td 728 字节
Newer Older
1 2 3
#ifndef PHI_KERNEL
#define PHI_KERNEL

4 5 6
include "mlir/Interfaces/SideEffectInterfaces.td"
include "mlir/IR/OpBase.td"
include "paddle/infrt/dialect/infrt_base.td"
7
include "paddle/infrt/dialect/phi/ir/infrt_phi_base.td"
8 9 10 11 12 13 14 15 16 17 18 19

def PHI_KernelDialect : Dialect {
  let name = "phi_kernel";

  let description = [{
    The PHI Kernel dialect.
  }];

  let cppNamespace = "::infrt::phi";
}

// PHI Kernel related ops.
20
class PDT_Kernel<string mnemonic, list<OpTrait> traits = []> : Op<PHI_KernelDialect, mnemonic, !listconcat(traits, [PhiOpTrait, IsolatedFromAbove])> {
21 22 23 24 25 26 27 28 29
}

def PDCK_AbsOp : PDT_Kernel<"phi.abs.host.fp32"> {
  let arguments = (ins CPU_Context:$dev_ctx, DenseTensor:$x);
  let results = (outs DenseTensor:$output);
}

#endif