infrt_base.td 1.0 KB
Newer Older
Y
Yan Chunwei 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
#ifndef INFRT_BASE
#define INFRT_BASE

include "mlir/IR/OpBase.td"

def INFRT_Dialect : Dialect {
  let name = "infrt";

  let description = [{
    The INFRT host dialect.
  }];

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

// Type definitions
def StringType :
    Type<CPred<"$_self.isa<::infrt::dt::StringType>()">, "!infrt.string type">,
    BuildableType<"$_builder.getType<::infrt::dt::StringType>()">;

def TensorType :
    Type<CPred<"$_self.isa<::infrt::dt::TensorType>()">, "!infrt.tensor type">;

def TensorMapType :
    Type<CPred<"$_self.isa<::infrt::dt::TensorMapType>()">, "!infrt.tensor_map type">,
    BuildableType<"$_builder.getType<::infrt::dt::TensorMapType>()">;

def BufferType : OpaqueType<"b", "buffer", "buffer">;

class INFRT_createI32Attr<string value> : NativeCodeCall<
31
    "infrt::createI32Attr($_builder, $_loc, " # value # ")">;
Y
Yan Chunwei 已提交
32 33

def INFRT_cvtValueToValueRange : NativeCodeCall<
34
    "infrt::cvtValueToValueRange($0)">;
Y
Yan Chunwei 已提交
35 36

def INFRT_concatTwoValueRange : NativeCodeCall<
37
    "infrt::concatTwoValueRange($0, $1)">;
Y
Yan Chunwei 已提交
38
#endif  // INFRT_BASE