Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions mlir/include/mlir-c/BuiltinTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAInteger(MlirType type);
MLIR_CAPI_EXPORTED MlirType mlirIntegerTypeGet(MlirContext ctx,
unsigned bitwidth);

MLIR_CAPI_EXPORTED MlirStringRef mlirIntegerTypeGetName(void);

/// Creates a signed integer type of the given bitwidth in the context. The type
/// is owned by the context.
MLIR_CAPI_EXPORTED MlirType mlirIntegerTypeSignedGet(MlirContext ctx,
Expand Down Expand Up @@ -69,6 +71,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAIndex(MlirType type);
/// context.
MLIR_CAPI_EXPORTED MlirType mlirIndexTypeGet(MlirContext ctx);

MLIR_CAPI_EXPORTED MlirStringRef mlirIndexTypeGetName(void);

//===----------------------------------------------------------------------===//
// Floating-point types.
//===----------------------------------------------------------------------===//
Expand All @@ -89,6 +93,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat4E2M1FN(MlirType type);
/// context.
MLIR_CAPI_EXPORTED MlirType mlirFloat4E2M1FNTypeGet(MlirContext ctx);

MLIR_CAPI_EXPORTED MlirStringRef mlirFloat4E2M1FNTypeGetName(void);

/// Returns the typeID of an Float6E2M3FN type.
MLIR_CAPI_EXPORTED MlirTypeID mlirFloat6E2M3FNTypeGetTypeID(void);

Expand All @@ -99,6 +105,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat6E2M3FN(MlirType type);
/// context.
MLIR_CAPI_EXPORTED MlirType mlirFloat6E2M3FNTypeGet(MlirContext ctx);

MLIR_CAPI_EXPORTED MlirStringRef mlirFloat6E2M3FNTypeGetName(void);

/// Returns the typeID of an Float6E3M2FN type.
MLIR_CAPI_EXPORTED MlirTypeID mlirFloat6E3M2FNTypeGetTypeID(void);

Expand All @@ -109,6 +117,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat6E3M2FN(MlirType type);
/// context.
MLIR_CAPI_EXPORTED MlirType mlirFloat6E3M2FNTypeGet(MlirContext ctx);

MLIR_CAPI_EXPORTED MlirStringRef mlirFloat6E3M2FNTypeGetName(void);

/// Returns the typeID of an Float8E5M2 type.
MLIR_CAPI_EXPORTED MlirTypeID mlirFloat8E5M2TypeGetTypeID(void);

Expand All @@ -119,6 +129,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat8E5M2(MlirType type);
/// context.
MLIR_CAPI_EXPORTED MlirType mlirFloat8E5M2TypeGet(MlirContext ctx);

MLIR_CAPI_EXPORTED MlirStringRef mlirFloat8E5M2TypeGetName(void);

/// Returns the typeID of an Float8E4M3 type.
MLIR_CAPI_EXPORTED MlirTypeID mlirFloat8E4M3TypeGetTypeID(void);

Expand All @@ -129,6 +141,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat8E4M3(MlirType type);
/// context.
MLIR_CAPI_EXPORTED MlirType mlirFloat8E4M3TypeGet(MlirContext ctx);

MLIR_CAPI_EXPORTED MlirStringRef mlirFloat8E4M3TypeGetName(void);

/// Returns the typeID of an Float8E4M3FN type.
MLIR_CAPI_EXPORTED MlirTypeID mlirFloat8E4M3FNTypeGetTypeID(void);

Expand All @@ -139,6 +153,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat8E4M3FN(MlirType type);
/// context.
MLIR_CAPI_EXPORTED MlirType mlirFloat8E4M3FNTypeGet(MlirContext ctx);

MLIR_CAPI_EXPORTED MlirStringRef mlirFloat8E4M3FNTypeGetName(void);

/// Returns the typeID of an Float8E5M2FNUZ type.
MLIR_CAPI_EXPORTED MlirTypeID mlirFloat8E5M2FNUZTypeGetTypeID(void);

Expand All @@ -149,6 +165,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat8E5M2FNUZ(MlirType type);
/// context.
MLIR_CAPI_EXPORTED MlirType mlirFloat8E5M2FNUZTypeGet(MlirContext ctx);

MLIR_CAPI_EXPORTED MlirStringRef mlirFloat8E5M2FNUZTypeGetName(void);

/// Returns the typeID of an Float8E4M3FNUZ type.
MLIR_CAPI_EXPORTED MlirTypeID mlirFloat8E4M3FNUZTypeGetTypeID(void);

Expand All @@ -159,6 +177,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat8E4M3FNUZ(MlirType type);
/// context.
MLIR_CAPI_EXPORTED MlirType mlirFloat8E4M3FNUZTypeGet(MlirContext ctx);

MLIR_CAPI_EXPORTED MlirStringRef mlirFloat8E4M3FNUZTypeGetName(void);

/// Returns the typeID of an Float8E4M3B11FNUZ type.
MLIR_CAPI_EXPORTED MlirTypeID mlirFloat8E4M3B11FNUZTypeGetTypeID(void);

Expand All @@ -169,6 +189,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat8E4M3B11FNUZ(MlirType type);
/// context.
MLIR_CAPI_EXPORTED MlirType mlirFloat8E4M3B11FNUZTypeGet(MlirContext ctx);

MLIR_CAPI_EXPORTED MlirStringRef mlirFloat8E4M3B11FNUZTypeGetName(void);

/// Returns the typeID of an Float8E3M4 type.
MLIR_CAPI_EXPORTED MlirTypeID mlirFloat8E3M4TypeGetTypeID(void);

Expand All @@ -179,6 +201,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat8E3M4(MlirType type);
/// context.
MLIR_CAPI_EXPORTED MlirType mlirFloat8E3M4TypeGet(MlirContext ctx);

MLIR_CAPI_EXPORTED MlirStringRef mlirFloat8E3M4TypeGetName(void);

/// Returns the typeID of an Float8E8M0FNU type.
MLIR_CAPI_EXPORTED MlirTypeID mlirFloat8E8M0FNUTypeGetTypeID(void);

Expand All @@ -189,6 +213,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat8E8M0FNU(MlirType type);
/// context.
MLIR_CAPI_EXPORTED MlirType mlirFloat8E8M0FNUTypeGet(MlirContext ctx);

MLIR_CAPI_EXPORTED MlirStringRef mlirFloat8E8M0FNUTypeGetName(void);

/// Returns the typeID of an BFloat16 type.
MLIR_CAPI_EXPORTED MlirTypeID mlirBFloat16TypeGetTypeID(void);

Expand All @@ -199,6 +225,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsABF16(MlirType type);
/// context.
MLIR_CAPI_EXPORTED MlirType mlirBF16TypeGet(MlirContext ctx);

MLIR_CAPI_EXPORTED MlirStringRef mlirBF16TypeGetName(void);

/// Returns the typeID of an Float16 type.
MLIR_CAPI_EXPORTED MlirTypeID mlirFloat16TypeGetTypeID(void);

Expand All @@ -209,6 +237,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAF16(MlirType type);
/// context.
MLIR_CAPI_EXPORTED MlirType mlirF16TypeGet(MlirContext ctx);

MLIR_CAPI_EXPORTED MlirStringRef mlirF16TypeGetName(void);

/// Returns the typeID of an Float32 type.
MLIR_CAPI_EXPORTED MlirTypeID mlirFloat32TypeGetTypeID(void);

Expand All @@ -219,6 +249,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAF32(MlirType type);
/// context.
MLIR_CAPI_EXPORTED MlirType mlirF32TypeGet(MlirContext ctx);

MLIR_CAPI_EXPORTED MlirStringRef mlirF32TypeGetName(void);

/// Returns the typeID of an Float64 type.
MLIR_CAPI_EXPORTED MlirTypeID mlirFloat64TypeGetTypeID(void);

Expand All @@ -229,6 +261,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAF64(MlirType type);
/// context.
MLIR_CAPI_EXPORTED MlirType mlirF64TypeGet(MlirContext ctx);

MLIR_CAPI_EXPORTED MlirStringRef mlirF64TypeGetName(void);

/// Returns the typeID of a TF32 type.
MLIR_CAPI_EXPORTED MlirTypeID mlirFloatTF32TypeGetTypeID(void);

Expand All @@ -239,6 +273,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsATF32(MlirType type);
/// context.
MLIR_CAPI_EXPORTED MlirType mlirTF32TypeGet(MlirContext ctx);

MLIR_CAPI_EXPORTED MlirStringRef mlirTF32TypeGetName(void);

//===----------------------------------------------------------------------===//
// None type.
//===----------------------------------------------------------------------===//
Expand All @@ -253,6 +289,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsANone(MlirType type);
/// context.
MLIR_CAPI_EXPORTED MlirType mlirNoneTypeGet(MlirContext ctx);

MLIR_CAPI_EXPORTED MlirStringRef mlirNoneTypeGetName(void);

//===----------------------------------------------------------------------===//
// Complex type.
//===----------------------------------------------------------------------===//
Expand All @@ -267,6 +305,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAComplex(MlirType type);
/// the element type. The type is owned by the context.
MLIR_CAPI_EXPORTED MlirType mlirComplexTypeGet(MlirType elementType);

MLIR_CAPI_EXPORTED MlirStringRef mlirComplexTypeGetName(void);

/// Returns the element type of the given complex type.
MLIR_CAPI_EXPORTED MlirType mlirComplexTypeGetElementType(MlirType type);

Expand Down Expand Up @@ -341,6 +381,8 @@ MLIR_CAPI_EXPORTED MlirType mlirVectorTypeGet(intptr_t rank,
const int64_t *shape,
MlirType elementType);

MLIR_CAPI_EXPORTED MlirStringRef mlirVectorTypeGetName(void);

/// Same as "mlirVectorTypeGet" but returns a nullptr wrapping MlirType on
/// illegal arguments, emitting appropriate diagnostics.
MLIR_CAPI_EXPORTED MlirType mlirVectorTypeGetChecked(MlirLocation loc,
Expand Down Expand Up @@ -402,6 +444,8 @@ MLIR_CAPI_EXPORTED MlirType mlirRankedTensorTypeGet(intptr_t rank,
MlirType elementType,
MlirAttribute encoding);

MLIR_CAPI_EXPORTED MlirStringRef mlirRankedTensorTypeGetName(void);

/// Same as "mlirRankedTensorTypeGet" but returns a nullptr wrapping MlirType on
/// illegal arguments, emitting appropriate diagnostics.
MLIR_CAPI_EXPORTED MlirType mlirRankedTensorTypeGetChecked(
Expand All @@ -416,6 +460,8 @@ MLIR_CAPI_EXPORTED MlirAttribute mlirRankedTensorTypeGetEncoding(MlirType type);
/// context as the element type. The type is owned by the context.
MLIR_CAPI_EXPORTED MlirType mlirUnrankedTensorTypeGet(MlirType elementType);

MLIR_CAPI_EXPORTED MlirStringRef mlirUnrankedTensorTypeGetName(void);

/// Same as "mlirUnrankedTensorTypeGet" but returns a nullptr wrapping MlirType
/// on illegal arguments, emitting appropriate diagnostics.
MLIR_CAPI_EXPORTED MlirType
Expand Down Expand Up @@ -446,6 +492,8 @@ MLIR_CAPI_EXPORTED MlirType mlirMemRefTypeGet(MlirType elementType,
MlirAttribute layout,
MlirAttribute memorySpace);

MLIR_CAPI_EXPORTED MlirStringRef mlirMemRefTypeGetName(void);

/// Same as "mlirMemRefTypeGet" but returns a nullptr-wrapping MlirType o
/// illegal arguments, emitting appropriate diagnostics.
MLIR_CAPI_EXPORTED MlirType mlirMemRefTypeGetChecked(
Expand All @@ -471,6 +519,8 @@ MLIR_CAPI_EXPORTED MlirType mlirMemRefTypeContiguousGetChecked(
MLIR_CAPI_EXPORTED MlirType
mlirUnrankedMemRefTypeGet(MlirType elementType, MlirAttribute memorySpace);

MLIR_CAPI_EXPORTED MlirStringRef mlirUnrankedMemRefTypeGetName(void);

/// Same as "mlirUnrankedMemRefTypeGet" but returns a nullptr wrapping
/// MlirType on illegal arguments, emitting appropriate diagnostics.
MLIR_CAPI_EXPORTED MlirType mlirUnrankedMemRefTypeGetChecked(
Expand Down Expand Up @@ -511,6 +561,8 @@ MLIR_CAPI_EXPORTED MlirType mlirTupleTypeGet(MlirContext ctx,
intptr_t numElements,
MlirType const *elements);

MLIR_CAPI_EXPORTED MlirStringRef mlirTupleTypeGetName(void);

/// Returns the number of types contained in a tuple.
MLIR_CAPI_EXPORTED intptr_t mlirTupleTypeGetNumTypes(MlirType type);

Expand All @@ -534,6 +586,8 @@ MLIR_CAPI_EXPORTED MlirType mlirFunctionTypeGet(MlirContext ctx,
intptr_t numResults,
MlirType const *results);

MLIR_CAPI_EXPORTED MlirStringRef mlirFunctionTypeGetName(void);

/// Returns the number of input types.
MLIR_CAPI_EXPORTED intptr_t mlirFunctionTypeGetNumInputs(MlirType type);

Expand Down Expand Up @@ -565,6 +619,8 @@ MLIR_CAPI_EXPORTED MlirType mlirOpaqueTypeGet(MlirContext ctx,
MlirStringRef dialectNamespace,
MlirStringRef typeData);

MLIR_CAPI_EXPORTED MlirStringRef mlirOpaqueTypeGetName(void);

/// Returns the namespace of the dialect with which the given opaque type
/// is associated. The namespace string is owned by the context.
MLIR_CAPI_EXPORTED MlirStringRef
Expand Down
6 changes: 6 additions & 0 deletions mlir/include/mlir-c/Dialect/AMDGPU.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ MLIR_CAPI_EXPORTED MlirTypeID mlirAMDGPUTDMBaseTypeGetTypeID();
MLIR_CAPI_EXPORTED MlirType mlirAMDGPUTDMBaseTypeGet(MlirContext ctx,
MlirType elementType);

MLIR_CAPI_EXPORTED MlirStringRef mlirAMDGPUTDMBaseTypeGetName(void);

//===---------------------------------------------------------------------===//
// TDMDescriptorType
//===---------------------------------------------------------------------===//
Expand All @@ -39,6 +41,8 @@ MLIR_CAPI_EXPORTED MlirTypeID mlirAMDGPUTDMDescriptorTypeGetTypeID();

MLIR_CAPI_EXPORTED MlirType mlirAMDGPUTDMDescriptorTypeGet(MlirContext ctx);

MLIR_CAPI_EXPORTED MlirStringRef mlirAMDGPUTDMDescriptorTypeGetName(void);

//===---------------------------------------------------------------------===//
// TDMGatherBaseType
//===---------------------------------------------------------------------===//
Expand All @@ -51,6 +55,8 @@ MLIR_CAPI_EXPORTED MlirType mlirAMDGPUTDMGatherBaseTypeGet(MlirContext ctx,
MlirType elementType,
MlirType indexType);

MLIR_CAPI_EXPORTED MlirStringRef mlirAMDGPUTDMGatherBaseTypeGetName(void);

#ifdef __cplusplus
}
#endif
Expand Down
14 changes: 14 additions & 0 deletions mlir/include/mlir-c/Dialect/EmitC.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ MLIR_CAPI_EXPORTED MlirType mlirEmitCArrayTypeGet(intptr_t nDims,
int64_t *shape,
MlirType elementType);

MLIR_CAPI_EXPORTED MlirStringRef mlirEmitCArrayTypeGetName(void);

//===---------------------------------------------------------------------===//
// LValueType
//===---------------------------------------------------------------------===//
Expand All @@ -51,6 +53,8 @@ MLIR_CAPI_EXPORTED MlirTypeID mlirEmitCLValueTypeGetTypeID(void);

MLIR_CAPI_EXPORTED MlirType mlirEmitCLValueTypeGet(MlirType valueType);

MLIR_CAPI_EXPORTED MlirStringRef mlirEmitCLValueTypeGetName(void);

//===---------------------------------------------------------------------===//
// OpaqueType
//===---------------------------------------------------------------------===//
Expand All @@ -62,6 +66,8 @@ MLIR_CAPI_EXPORTED MlirTypeID mlirEmitCOpaqueTypeGetTypeID(void);
MLIR_CAPI_EXPORTED MlirType mlirEmitCOpaqueTypeGet(MlirContext ctx,
MlirStringRef value);

MLIR_CAPI_EXPORTED MlirStringRef mlirEmitCOpaqueTypeGetName(void);

//===---------------------------------------------------------------------===//
// PointerType
//===---------------------------------------------------------------------===//
Expand All @@ -72,6 +78,8 @@ MLIR_CAPI_EXPORTED MlirTypeID mlirEmitCPointerTypeGetTypeID(void);

MLIR_CAPI_EXPORTED MlirType mlirEmitCPointerTypeGet(MlirType pointee);

MLIR_CAPI_EXPORTED MlirStringRef mlirEmitCPointerTypeGetName(void);

//===---------------------------------------------------------------------===//
// PtrDiffTType
//===---------------------------------------------------------------------===//
Expand All @@ -82,6 +90,8 @@ MLIR_CAPI_EXPORTED MlirTypeID mlirEmitCPtrDiffTTypeGetTypeID(void);

MLIR_CAPI_EXPORTED MlirType mlirEmitCPtrDiffTTypeGet(MlirContext ctx);

MLIR_CAPI_EXPORTED MlirStringRef mlirEmitCPtrDiffTTypeGetName(void);

//===---------------------------------------------------------------------===//
// SignedSizeTType
//===---------------------------------------------------------------------===//
Expand All @@ -92,6 +102,8 @@ MLIR_CAPI_EXPORTED MlirTypeID mlirEmitCSignedSizeTTypeGetTypeID(void);

MLIR_CAPI_EXPORTED MlirType mlirEmitCSignedSizeTTypeGet(MlirContext ctx);

MLIR_CAPI_EXPORTED MlirStringRef mlirEmitCSignedSizeTTypeGetName(void);

//===---------------------------------------------------------------------===//
// SizeTType
//===---------------------------------------------------------------------===//
Expand All @@ -102,6 +114,8 @@ MLIR_CAPI_EXPORTED MlirTypeID mlirEmitCSizeTTypeGetTypeID(void);

MLIR_CAPI_EXPORTED MlirType mlirEmitCSizeTTypeGet(MlirContext ctx);

MLIR_CAPI_EXPORTED MlirStringRef mlirEmitCSizeTTypeGetName(void);

//===----------------------------------------------------------------------===//
// CmpPredicate attribute.
//===----------------------------------------------------------------------===//
Expand Down
2 changes: 2 additions & 0 deletions mlir/include/mlir-c/Dialect/GPU.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAGPUAsyncTokenType(MlirType type);

MLIR_CAPI_EXPORTED MlirType mlirGPUAsyncTokenTypeGet(MlirContext ctx);

MLIR_CAPI_EXPORTED MlirStringRef mlirGPUAsyncTokenTypeGetName(void);

//===---------------------------------------------------------------------===//
// ObjectAttr
//===---------------------------------------------------------------------===//
Expand Down
10 changes: 10 additions & 0 deletions mlir/include/mlir-c/Dialect/LLVM.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ MLIR_DECLARE_CAPI_DIALECT_REGISTRATION(LLVM, llvm);
MLIR_CAPI_EXPORTED MlirType mlirLLVMPointerTypeGet(MlirContext ctx,
unsigned addressSpace);

MLIR_CAPI_EXPORTED MlirStringRef mlirLLVMPointerTypeGetName(void);

MLIR_CAPI_EXPORTED MlirTypeID mlirLLVMPointerTypeGetTypeID(void);

/// Returns `true` if the type is an LLVM dialect pointer type.
Expand All @@ -35,10 +37,14 @@ mlirLLVMPointerTypeGetAddressSpace(MlirType pointerType);
/// Creates an llmv.void type.
MLIR_CAPI_EXPORTED MlirType mlirLLVMVoidTypeGet(MlirContext ctx);

MLIR_CAPI_EXPORTED MlirStringRef mlirLLVMVoidTypeGetName(void);

/// Creates an llvm.array type.
MLIR_CAPI_EXPORTED MlirType mlirLLVMArrayTypeGet(MlirType elementType,
unsigned numElements);

MLIR_CAPI_EXPORTED MlirStringRef mlirLLVMArrayTypeGetName(void);

/// Returns the element type of the llvm.array type.
MLIR_CAPI_EXPORTED MlirType mlirLLVMArrayTypeGetElementType(MlirType type);

Expand All @@ -47,6 +53,8 @@ MLIR_CAPI_EXPORTED MlirType
mlirLLVMFunctionTypeGet(MlirType resultType, intptr_t nArgumentTypes,
MlirType const *argumentTypes, bool isVarArg);

MLIR_CAPI_EXPORTED MlirStringRef mlirLLVMFunctionTypeGetName(void);

/// Returns the number of input types.
MLIR_CAPI_EXPORTED intptr_t mlirLLVMFunctionTypeGetNumInputs(MlirType type);

Expand All @@ -62,6 +70,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsALLVMStructType(MlirType type);

MLIR_CAPI_EXPORTED MlirTypeID mlirLLVMStructTypeGetTypeID(void);

MLIR_CAPI_EXPORTED MlirStringRef mlirLLVMStructTypeGetName(void);

/// Returns `true` if the type is a literal (unnamed) LLVM struct type.
MLIR_CAPI_EXPORTED bool mlirLLVMStructTypeIsLiteral(MlirType type);

Expand Down
Loading