MLIR  18.0.0git
BuiltinTypes.h
Go to the documentation of this file.
1 //===-- mlir-c/BuiltinTypes.h - C API for MLIR Builtin types ------*- C -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM
4 // Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef MLIR_C_BUILTINTYPES_H
11 #define MLIR_C_BUILTINTYPES_H
12 
13 #include "mlir-c/AffineMap.h"
14 #include "mlir-c/IR.h"
15 #include <stdint.h>
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 //===----------------------------------------------------------------------===//
22 // Integer types.
23 //===----------------------------------------------------------------------===//
24 
25 /// Returns the typeID of an Integer type.
27 
28 /// Checks whether the given type is an integer type.
29 MLIR_CAPI_EXPORTED bool mlirTypeIsAInteger(MlirType type);
30 
31 /// Creates a signless integer type of the given bitwidth in the context. The
32 /// type is owned by the context.
33 MLIR_CAPI_EXPORTED MlirType mlirIntegerTypeGet(MlirContext ctx,
34  unsigned bitwidth);
35 
36 /// Creates a signed integer type of the given bitwidth in the context. The type
37 /// is owned by the context.
38 MLIR_CAPI_EXPORTED MlirType mlirIntegerTypeSignedGet(MlirContext ctx,
39  unsigned bitwidth);
40 
41 /// Creates an unsigned integer type of the given bitwidth in the context. The
42 /// type is owned by the context.
43 MLIR_CAPI_EXPORTED MlirType mlirIntegerTypeUnsignedGet(MlirContext ctx,
44  unsigned bitwidth);
45 
46 /// Returns the bitwidth of an integer type.
47 MLIR_CAPI_EXPORTED unsigned mlirIntegerTypeGetWidth(MlirType type);
48 
49 /// Checks whether the given integer type is signless.
51 
52 /// Checks whether the given integer type is signed.
54 
55 /// Checks whether the given integer type is unsigned.
57 
58 //===----------------------------------------------------------------------===//
59 // Index type.
60 //===----------------------------------------------------------------------===//
61 
62 /// Returns the typeID of an Index type.
64 
65 /// Checks whether the given type is an index type.
66 MLIR_CAPI_EXPORTED bool mlirTypeIsAIndex(MlirType type);
67 
68 /// Creates an index type in the given context. The type is owned by the
69 /// context.
70 MLIR_CAPI_EXPORTED MlirType mlirIndexTypeGet(MlirContext ctx);
71 
72 //===----------------------------------------------------------------------===//
73 // Floating-point types.
74 //===----------------------------------------------------------------------===//
75 
76 /// Returns the typeID of an Float8E5M2 type.
78 
79 /// Checks whether the given type is an f8E5M2 type.
80 MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat8E5M2(MlirType type);
81 
82 /// Creates an f8E5M2 type in the given context. The type is owned by the
83 /// context.
84 MLIR_CAPI_EXPORTED MlirType mlirFloat8E5M2TypeGet(MlirContext ctx);
85 
86 /// Returns the typeID of an Float8E4M3FN type.
88 
89 /// Checks whether the given type is an f8E4M3FN type.
91 
92 /// Creates an f8E4M3FN type in the given context. The type is owned by the
93 /// context.
94 MLIR_CAPI_EXPORTED MlirType mlirFloat8E4M3FNTypeGet(MlirContext ctx);
95 
96 /// Returns the typeID of an Float8E5M2FNUZ type.
98 
99 /// Checks whether the given type is an f8E5M2FNUZ type.
101 
102 /// Creates an f8E5M2FNUZ type in the given context. The type is owned by the
103 /// context.
104 MLIR_CAPI_EXPORTED MlirType mlirFloat8E5M2FNUZTypeGet(MlirContext ctx);
105 
106 /// Returns the typeID of an Float8E4M3FNUZ type.
108 
109 /// Checks whether the given type is an f8E4M3FNUZ type.
111 
112 /// Creates an f8E4M3FNUZ type in the given context. The type is owned by the
113 /// context.
114 MLIR_CAPI_EXPORTED MlirType mlirFloat8E4M3FNUZTypeGet(MlirContext ctx);
115 
116 /// Returns the typeID of an Float8E4M3B11FNUZ type.
118 
119 /// Checks whether the given type is an f8E4M3B11FNUZ type.
121 
122 /// Creates an f8E4M3B11FNUZ type in the given context. The type is owned by the
123 /// context.
124 MLIR_CAPI_EXPORTED MlirType mlirFloat8E4M3B11FNUZTypeGet(MlirContext ctx);
125 
126 /// Returns the typeID of an BFloat16 type.
128 
129 /// Checks whether the given type is a bf16 type.
130 MLIR_CAPI_EXPORTED bool mlirTypeIsABF16(MlirType type);
131 
132 /// Creates a bf16 type in the given context. The type is owned by the
133 /// context.
134 MLIR_CAPI_EXPORTED MlirType mlirBF16TypeGet(MlirContext ctx);
135 
136 /// Returns the typeID of an Float16 type.
138 
139 /// Checks whether the given type is an f16 type.
140 MLIR_CAPI_EXPORTED bool mlirTypeIsAF16(MlirType type);
141 
142 /// Creates an f16 type in the given context. The type is owned by the
143 /// context.
144 MLIR_CAPI_EXPORTED MlirType mlirF16TypeGet(MlirContext ctx);
145 
146 /// Returns the typeID of an Float32 type.
148 
149 /// Checks whether the given type is an f32 type.
150 MLIR_CAPI_EXPORTED bool mlirTypeIsAF32(MlirType type);
151 
152 /// Creates an f32 type in the given context. The type is owned by the
153 /// context.
154 MLIR_CAPI_EXPORTED MlirType mlirF32TypeGet(MlirContext ctx);
155 
156 /// Returns the typeID of an Float64 type.
158 
159 /// Checks whether the given type is an f64 type.
160 MLIR_CAPI_EXPORTED bool mlirTypeIsAF64(MlirType type);
161 
162 /// Creates a f64 type in the given context. The type is owned by the
163 /// context.
164 MLIR_CAPI_EXPORTED MlirType mlirF64TypeGet(MlirContext ctx);
165 
166 /// Returns the typeID of a TF32 type.
168 
169 /// Checks whether the given type is an TF32 type.
170 MLIR_CAPI_EXPORTED bool mlirTypeIsATF32(MlirType type);
171 
172 /// Creates a TF32 type in the given context. The type is owned by the
173 /// context.
174 MLIR_CAPI_EXPORTED MlirType mlirTF32TypeGet(MlirContext ctx);
175 
176 //===----------------------------------------------------------------------===//
177 // None type.
178 //===----------------------------------------------------------------------===//
179 
180 /// Returns the typeID of an None type.
182 
183 /// Checks whether the given type is a None type.
184 MLIR_CAPI_EXPORTED bool mlirTypeIsANone(MlirType type);
185 
186 /// Creates a None type in the given context. The type is owned by the
187 /// context.
188 MLIR_CAPI_EXPORTED MlirType mlirNoneTypeGet(MlirContext ctx);
189 
190 //===----------------------------------------------------------------------===//
191 // Complex type.
192 //===----------------------------------------------------------------------===//
193 
194 /// Returns the typeID of an Complex type.
196 
197 /// Checks whether the given type is a Complex type.
198 MLIR_CAPI_EXPORTED bool mlirTypeIsAComplex(MlirType type);
199 
200 /// Creates a complex type with the given element type in the same context as
201 /// the element type. The type is owned by the context.
202 MLIR_CAPI_EXPORTED MlirType mlirComplexTypeGet(MlirType elementType);
203 
204 /// Returns the element type of the given complex type.
205 MLIR_CAPI_EXPORTED MlirType mlirComplexTypeGetElementType(MlirType type);
206 
207 //===----------------------------------------------------------------------===//
208 // Shaped type.
209 //===----------------------------------------------------------------------===//
210 
211 /// Checks whether the given type is a Shaped type.
212 MLIR_CAPI_EXPORTED bool mlirTypeIsAShaped(MlirType type);
213 
214 /// Returns the element type of the shaped type.
215 MLIR_CAPI_EXPORTED MlirType mlirShapedTypeGetElementType(MlirType type);
216 
217 /// Checks whether the given shaped type is ranked.
218 MLIR_CAPI_EXPORTED bool mlirShapedTypeHasRank(MlirType type);
219 
220 /// Returns the rank of the given ranked shaped type.
221 MLIR_CAPI_EXPORTED int64_t mlirShapedTypeGetRank(MlirType type);
222 
223 /// Checks whether the given shaped type has a static shape.
225 
226 /// Checks wither the dim-th dimension of the given shaped type is dynamic.
227 MLIR_CAPI_EXPORTED bool mlirShapedTypeIsDynamicDim(MlirType type, intptr_t dim);
228 
229 /// Returns the dim-th dimension of the given ranked shaped type.
230 MLIR_CAPI_EXPORTED int64_t mlirShapedTypeGetDimSize(MlirType type,
231  intptr_t dim);
232 
233 /// Checks whether the given value is used as a placeholder for dynamic sizes
234 /// in shaped types.
236 
237 /// Returns the value indicating a dynamic size in a shaped type. Prefer
238 /// mlirShapedTypeIsDynamicSize to direct comparisons with this value.
240 
241 /// Checks whether the given value is used as a placeholder for dynamic strides
242 /// and offsets in shaped types.
244 
245 /// Returns the value indicating a dynamic stride or offset in a shaped type.
246 /// Prefer mlirShapedTypeGetDynamicStrideOrOffset to direct comparisons with
247 /// this value.
249 
250 //===----------------------------------------------------------------------===//
251 // Vector type.
252 //===----------------------------------------------------------------------===//
253 
254 /// Returns the typeID of an Vector type.
256 
257 /// Checks whether the given type is a Vector type.
258 MLIR_CAPI_EXPORTED bool mlirTypeIsAVector(MlirType type);
259 
260 /// Creates a vector type of the shape identified by its rank and dimensions,
261 /// with the given element type in the same context as the element type. The
262 /// type is owned by the context.
263 MLIR_CAPI_EXPORTED MlirType mlirVectorTypeGet(intptr_t rank,
264  const int64_t *shape,
265  MlirType elementType);
266 
267 /// Same as "mlirVectorTypeGet" but returns a nullptr wrapping MlirType on
268 /// illegal arguments, emitting appropriate diagnostics.
269 MLIR_CAPI_EXPORTED MlirType mlirVectorTypeGetChecked(MlirLocation loc,
270  intptr_t rank,
271  const int64_t *shape,
272  MlirType elementType);
273 
274 /// Creates a scalable vector type with the shape identified by its rank and
275 /// dimensions. A subset of dimensions may be marked as scalable via the
276 /// corresponding flag list, which is expected to have as many entries as the
277 /// rank of the vector. The vector is created in the same context as the element
278 /// type.
279 MLIR_CAPI_EXPORTED MlirType mlirVectorTypeGetScalable(intptr_t rank,
280  const int64_t *shape,
281  const bool *scalable,
282  MlirType elementType);
283 
284 /// Same as "mlirVectorTypeGetScalable" but returns a nullptr wrapping MlirType
285 /// on illegal arguments, emitting appropriate diagnostics.
287 MlirType mlirVectorTypeGetScalableChecked(MlirLocation loc, intptr_t rank,
288  const int64_t *shape,
289  const bool *scalable,
290  MlirType elementType);
291 
292 /// Checks whether the given vector type is scalable, i.e., has at least one
293 /// scalable dimension.
294 MLIR_CAPI_EXPORTED bool mlirVectorTypeIsScalable(MlirType type);
295 
296 /// Checks whether the "dim"-th dimension of the given vector is scalable.
298  intptr_t dim);
299 
300 //===----------------------------------------------------------------------===//
301 // Ranked / Unranked Tensor type.
302 //===----------------------------------------------------------------------===//
303 
304 /// Checks whether the given type is a Tensor type.
305 MLIR_CAPI_EXPORTED bool mlirTypeIsATensor(MlirType type);
306 
307 /// Returns the typeID of an RankedTensor type.
309 
310 /// Checks whether the given type is a ranked tensor type.
311 MLIR_CAPI_EXPORTED bool mlirTypeIsARankedTensor(MlirType type);
312 
313 /// Returns the typeID of an UnrankedTensor type.
315 
316 /// Checks whether the given type is an unranked tensor type.
318 
319 /// Creates a tensor type of a fixed rank with the given shape, element type,
320 /// and optional encoding in the same context as the element type. The type is
321 /// owned by the context. Tensor types without any specific encoding field
322 /// should assign mlirAttributeGetNull() to this parameter.
323 MLIR_CAPI_EXPORTED MlirType mlirRankedTensorTypeGet(intptr_t rank,
324  const int64_t *shape,
325  MlirType elementType,
326  MlirAttribute encoding);
327 
328 /// Same as "mlirRankedTensorTypeGet" but returns a nullptr wrapping MlirType on
329 /// illegal arguments, emitting appropriate diagnostics.
331  MlirLocation loc, intptr_t rank, const int64_t *shape, MlirType elementType,
332  MlirAttribute encoding);
333 
334 /// Gets the 'encoding' attribute from the ranked tensor type, returning a null
335 /// attribute if none.
336 MLIR_CAPI_EXPORTED MlirAttribute mlirRankedTensorTypeGetEncoding(MlirType type);
337 
338 /// Creates an unranked tensor type with the given element type in the same
339 /// context as the element type. The type is owned by the context.
340 MLIR_CAPI_EXPORTED MlirType mlirUnrankedTensorTypeGet(MlirType elementType);
341 
342 /// Same as "mlirUnrankedTensorTypeGet" but returns a nullptr wrapping MlirType
343 /// on illegal arguments, emitting appropriate diagnostics.
344 MLIR_CAPI_EXPORTED MlirType
345 mlirUnrankedTensorTypeGetChecked(MlirLocation loc, MlirType elementType);
346 
347 //===----------------------------------------------------------------------===//
348 // Ranked / Unranked MemRef type.
349 //===----------------------------------------------------------------------===//
350 
351 /// Returns the typeID of an MemRef type.
353 
354 /// Checks whether the given type is a MemRef type.
355 MLIR_CAPI_EXPORTED bool mlirTypeIsAMemRef(MlirType type);
356 
357 /// Returns the typeID of an UnrankedMemRef type.
359 
360 /// Checks whether the given type is an UnrankedMemRef type.
362 
363 /// Creates a MemRef type with the given rank and shape, a potentially empty
364 /// list of affine layout maps, the given memory space and element type, in the
365 /// same context as element type. The type is owned by the context.
366 MLIR_CAPI_EXPORTED MlirType mlirMemRefTypeGet(MlirType elementType,
367  intptr_t rank,
368  const int64_t *shape,
369  MlirAttribute layout,
370  MlirAttribute memorySpace);
371 
372 /// Same as "mlirMemRefTypeGet" but returns a nullptr-wrapping MlirType o
373 /// illegal arguments, emitting appropriate diagnostics.
375  MlirLocation loc, MlirType elementType, intptr_t rank, const int64_t *shape,
376  MlirAttribute layout, MlirAttribute memorySpace);
377 
378 /// Creates a MemRef type with the given rank, shape, memory space and element
379 /// type in the same context as the element type. The type has no affine maps,
380 /// i.e. represents a default row-major contiguous memref. The type is owned by
381 /// the context.
382 MLIR_CAPI_EXPORTED MlirType
383 mlirMemRefTypeContiguousGet(MlirType elementType, intptr_t rank,
384  const int64_t *shape, MlirAttribute memorySpace);
385 
386 /// Same as "mlirMemRefTypeContiguousGet" but returns a nullptr wrapping
387 /// MlirType on illegal arguments, emitting appropriate diagnostics.
389  MlirLocation loc, MlirType elementType, intptr_t rank, const int64_t *shape,
390  MlirAttribute memorySpace);
391 
392 /// Creates an Unranked MemRef type with the given element type and in the given
393 /// memory space. The type is owned by the context of element type.
394 MLIR_CAPI_EXPORTED MlirType
395 mlirUnrankedMemRefTypeGet(MlirType elementType, MlirAttribute memorySpace);
396 
397 /// Same as "mlirUnrankedMemRefTypeGet" but returns a nullptr wrapping
398 /// MlirType on illegal arguments, emitting appropriate diagnostics.
400  MlirLocation loc, MlirType elementType, MlirAttribute memorySpace);
401 
402 /// Returns the layout of the given MemRef type.
403 MLIR_CAPI_EXPORTED MlirAttribute mlirMemRefTypeGetLayout(MlirType type);
404 
405 /// Returns the affine map of the given MemRef type.
406 MLIR_CAPI_EXPORTED MlirAffineMap mlirMemRefTypeGetAffineMap(MlirType type);
407 
408 /// Returns the memory space of the given MemRef type.
409 MLIR_CAPI_EXPORTED MlirAttribute mlirMemRefTypeGetMemorySpace(MlirType type);
410 
411 /// Returns the memory spcae of the given Unranked MemRef type.
412 MLIR_CAPI_EXPORTED MlirAttribute
413 mlirUnrankedMemrefGetMemorySpace(MlirType type);
414 
415 //===----------------------------------------------------------------------===//
416 // Tuple type.
417 //===----------------------------------------------------------------------===//
418 
419 /// Returns the typeID of an Tuple type.
421 
422 /// Checks whether the given type is a tuple type.
423 MLIR_CAPI_EXPORTED bool mlirTypeIsATuple(MlirType type);
424 
425 /// Creates a tuple type that consists of the given list of elemental types. The
426 /// type is owned by the context.
427 MLIR_CAPI_EXPORTED MlirType mlirTupleTypeGet(MlirContext ctx,
428  intptr_t numElements,
429  MlirType const *elements);
430 
431 /// Returns the number of types contained in a tuple.
432 MLIR_CAPI_EXPORTED intptr_t mlirTupleTypeGetNumTypes(MlirType type);
433 
434 /// Returns the pos-th type in the tuple type.
435 MLIR_CAPI_EXPORTED MlirType mlirTupleTypeGetType(MlirType type, intptr_t pos);
436 
437 //===----------------------------------------------------------------------===//
438 // Function type.
439 //===----------------------------------------------------------------------===//
440 
441 /// Returns the typeID of an Function type.
443 
444 /// Checks whether the given type is a function type.
445 MLIR_CAPI_EXPORTED bool mlirTypeIsAFunction(MlirType type);
446 
447 /// Creates a function type, mapping a list of input types to result types.
448 MLIR_CAPI_EXPORTED MlirType mlirFunctionTypeGet(MlirContext ctx,
449  intptr_t numInputs,
450  MlirType const *inputs,
451  intptr_t numResults,
452  MlirType const *results);
453 
454 /// Returns the number of input types.
455 MLIR_CAPI_EXPORTED intptr_t mlirFunctionTypeGetNumInputs(MlirType type);
456 
457 /// Returns the number of result types.
458 MLIR_CAPI_EXPORTED intptr_t mlirFunctionTypeGetNumResults(MlirType type);
459 
460 /// Returns the pos-th input type.
461 MLIR_CAPI_EXPORTED MlirType mlirFunctionTypeGetInput(MlirType type,
462  intptr_t pos);
463 
464 /// Returns the pos-th result type.
465 MLIR_CAPI_EXPORTED MlirType mlirFunctionTypeGetResult(MlirType type,
466  intptr_t pos);
467 
468 //===----------------------------------------------------------------------===//
469 // Opaque type.
470 //===----------------------------------------------------------------------===//
471 
472 /// Returns the typeID of an Opaque type.
474 
475 /// Checks whether the given type is an opaque type.
476 MLIR_CAPI_EXPORTED bool mlirTypeIsAOpaque(MlirType type);
477 
478 /// Creates an opaque type in the given context associated with the dialect
479 /// identified by its namespace. The type contains opaque byte data of the
480 /// specified length (data need not be null-terminated).
481 MLIR_CAPI_EXPORTED MlirType mlirOpaqueTypeGet(MlirContext ctx,
482  MlirStringRef dialectNamespace,
483  MlirStringRef typeData);
484 
485 /// Returns the namespace of the dialect with which the given opaque type
486 /// is associated. The namespace string is owned by the context.
488 mlirOpaqueTypeGetDialectNamespace(MlirType type);
489 
490 /// Returns the raw data as a string reference. The data remains live as long as
491 /// the context in which the type lives.
493 
494 #ifdef __cplusplus
495 }
496 #endif
497 
498 #endif // MLIR_C_BUILTINTYPES_H
MLIR_CAPI_EXPORTED MlirType mlirRankedTensorTypeGet(intptr_t rank, const int64_t *shape, MlirType elementType, MlirAttribute encoding)
Creates a tensor type of a fixed rank with the given shape, element type, and optional encoding in th...
MLIR_CAPI_EXPORTED bool mlirIntegerTypeIsSignless(MlirType type)
Checks whether the given integer type is signless.
MLIR_CAPI_EXPORTED bool mlirTypeIsAMemRef(MlirType type)
Checks whether the given type is a MemRef type.
MLIR_CAPI_EXPORTED MlirAttribute mlirRankedTensorTypeGetEncoding(MlirType type)
Gets the 'encoding' attribute from the ranked tensor type, returning a null attribute if none.
MLIR_CAPI_EXPORTED MlirTypeID mlirFloat16TypeGetTypeID(void)
Returns the typeID of an Float16 type.
MLIR_CAPI_EXPORTED bool mlirTypeIsAInteger(MlirType type)
Checks whether the given type is an integer type.
MLIR_CAPI_EXPORTED MlirAffineMap mlirMemRefTypeGetAffineMap(MlirType type)
Returns the affine map of the given MemRef type.
MLIR_CAPI_EXPORTED MlirType mlirMemRefTypeContiguousGet(MlirType elementType, intptr_t rank, const int64_t *shape, MlirAttribute memorySpace)
Creates a MemRef type with the given rank, shape, memory space and element type in the same context a...
MLIR_CAPI_EXPORTED MlirTypeID mlirFloatTF32TypeGetTypeID(void)
Returns the typeID of a TF32 type.
MLIR_CAPI_EXPORTED int64_t mlirShapedTypeGetDimSize(MlirType type, intptr_t dim)
Returns the dim-th dimension of the given ranked shaped type.
MLIR_CAPI_EXPORTED MlirTypeID mlirNoneTypeGetTypeID(void)
Returns the typeID of an None type.
MLIR_CAPI_EXPORTED MlirTypeID mlirFloat8E4M3FNUZTypeGetTypeID(void)
Returns the typeID of an Float8E4M3FNUZ type.
MLIR_CAPI_EXPORTED MlirType mlirIntegerTypeGet(MlirContext ctx, unsigned bitwidth)
Creates a signless integer type of the given bitwidth in the context.
MLIR_CAPI_EXPORTED MlirStringRef mlirOpaqueTypeGetData(MlirType type)
Returns the raw data as a string reference.
MLIR_CAPI_EXPORTED bool mlirTypeIsAVector(MlirType type)
Checks whether the given type is a Vector type.
MLIR_CAPI_EXPORTED MlirType mlirFunctionTypeGetInput(MlirType type, intptr_t pos)
Returns the pos-th input type.
MLIR_CAPI_EXPORTED MlirType mlirIndexTypeGet(MlirContext ctx)
Creates an index type in the given context.
MLIR_CAPI_EXPORTED MlirTypeID mlirVectorTypeGetTypeID(void)
Returns the typeID of an Vector type.
MLIR_CAPI_EXPORTED bool mlirTypeIsAFunction(MlirType type)
Checks whether the given type is a function type.
MLIR_CAPI_EXPORTED MlirType mlirFloat8E5M2FNUZTypeGet(MlirContext ctx)
Creates an f8E5M2FNUZ type in the given context.
MLIR_CAPI_EXPORTED MlirTypeID mlirUnrankedTensorTypeGetTypeID(void)
Returns the typeID of an UnrankedTensor type.
MLIR_CAPI_EXPORTED bool mlirIntegerTypeIsUnsigned(MlirType type)
Checks whether the given integer type is unsigned.
MLIR_CAPI_EXPORTED bool mlirTypeIsATensor(MlirType type)
Checks whether the given type is a Tensor type.
MLIR_CAPI_EXPORTED MlirTypeID mlirMemRefTypeGetTypeID(void)
Returns the typeID of an MemRef type.
MLIR_CAPI_EXPORTED unsigned mlirIntegerTypeGetWidth(MlirType type)
Returns the bitwidth of an integer type.
MLIR_CAPI_EXPORTED MlirType mlirFloat8E5M2TypeGet(MlirContext ctx)
Creates an f8E5M2 type in the given context.
MLIR_CAPI_EXPORTED int64_t mlirShapedTypeGetRank(MlirType type)
Returns the rank of the given ranked shaped type.
MLIR_CAPI_EXPORTED MlirType mlirF64TypeGet(MlirContext ctx)
Creates a f64 type in the given context.
MLIR_CAPI_EXPORTED MlirType mlirIntegerTypeSignedGet(MlirContext ctx, unsigned bitwidth)
Creates a signed integer type of the given bitwidth in the context.
MLIR_CAPI_EXPORTED MlirType mlirUnrankedTensorTypeGetChecked(MlirLocation loc, MlirType elementType)
Same as "mlirUnrankedTensorTypeGet" but returns a nullptr wrapping MlirType on illegal arguments,...
MLIR_CAPI_EXPORTED MlirType mlirVectorTypeGetScalableChecked(MlirLocation loc, intptr_t rank, const int64_t *shape, const bool *scalable, MlirType elementType)
Same as "mlirVectorTypeGetScalable" but returns a nullptr wrapping MlirType on illegal arguments,...
MLIR_CAPI_EXPORTED MlirType mlirF16TypeGet(MlirContext ctx)
Creates an f16 type in the given context.
MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat8E5M2(MlirType type)
Checks whether the given type is an f8E5M2 type.
MLIR_CAPI_EXPORTED MlirAttribute mlirMemRefTypeGetMemorySpace(MlirType type)
Returns the memory space of the given MemRef type.
MLIR_CAPI_EXPORTED bool mlirTypeIsAF64(MlirType type)
Checks whether the given type is an f64 type.
MLIR_CAPI_EXPORTED bool mlirTypeIsAF16(MlirType type)
Checks whether the given type is an f16 type.
MLIR_CAPI_EXPORTED bool mlirIntegerTypeIsSigned(MlirType type)
Checks whether the given integer type is signed.
MLIR_CAPI_EXPORTED MlirType mlirRankedTensorTypeGetChecked(MlirLocation loc, intptr_t rank, const int64_t *shape, MlirType elementType, MlirAttribute encoding)
Same as "mlirRankedTensorTypeGet" but returns a nullptr wrapping MlirType on illegal arguments,...
MLIR_CAPI_EXPORTED MlirType mlirVectorTypeGetScalable(intptr_t rank, const int64_t *shape, const bool *scalable, MlirType elementType)
Creates a scalable vector type with the shape identified by its rank and dimensions.
MLIR_CAPI_EXPORTED MlirTypeID mlirFloat8E5M2FNUZTypeGetTypeID(void)
Returns the typeID of an Float8E5M2FNUZ type.
MLIR_CAPI_EXPORTED MlirType mlirShapedTypeGetElementType(MlirType type)
Returns the element type of the shaped type.
MLIR_CAPI_EXPORTED MlirTypeID mlirFloat64TypeGetTypeID(void)
Returns the typeID of an Float64 type.
MLIR_CAPI_EXPORTED bool mlirTypeIsATuple(MlirType type)
Checks whether the given type is a tuple type.
MLIR_CAPI_EXPORTED intptr_t mlirFunctionTypeGetNumInputs(MlirType type)
Returns the number of input types.
MLIR_CAPI_EXPORTED MlirTypeID mlirFloat8E5M2TypeGetTypeID(void)
Returns the typeID of an Float8E5M2 type.
MLIR_CAPI_EXPORTED MlirType mlirVectorTypeGetChecked(MlirLocation loc, intptr_t rank, const int64_t *shape, MlirType elementType)
Same as "mlirVectorTypeGet" but returns a nullptr wrapping MlirType on illegal arguments,...
MLIR_CAPI_EXPORTED MlirType mlirNoneTypeGet(MlirContext ctx)
Creates a None type in the given context.
MLIR_CAPI_EXPORTED MlirType mlirComplexTypeGet(MlirType elementType)
Creates a complex type with the given element type in the same context as the element type.
MLIR_CAPI_EXPORTED MlirStringRef mlirOpaqueTypeGetDialectNamespace(MlirType type)
Returns the namespace of the dialect with which the given opaque type is associated.
MLIR_CAPI_EXPORTED MlirTypeID mlirTupleTypeGetTypeID(void)
Returns the typeID of an Tuple type.
MLIR_CAPI_EXPORTED bool mlirShapedTypeHasStaticShape(MlirType type)
Checks whether the given shaped type has a static shape.
MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat8E4M3FN(MlirType type)
Checks whether the given type is an f8E4M3FN type.
MLIR_CAPI_EXPORTED MlirTypeID mlirFloat8E4M3FNTypeGetTypeID(void)
Returns the typeID of an Float8E4M3FN type.
MLIR_CAPI_EXPORTED bool mlirTypeIsAOpaque(MlirType type)
Checks whether the given type is an opaque type.
MLIR_CAPI_EXPORTED MlirType mlirBF16TypeGet(MlirContext ctx)
Creates a bf16 type in the given context.
MLIR_CAPI_EXPORTED MlirType mlirF32TypeGet(MlirContext ctx)
Creates an f32 type in the given context.
MLIR_CAPI_EXPORTED bool mlirShapedTypeHasRank(MlirType type)
Checks whether the given shaped type is ranked.
MLIR_CAPI_EXPORTED bool mlirTypeIsAShaped(MlirType type)
Checks whether the given type is a Shaped type.
MLIR_CAPI_EXPORTED intptr_t mlirTupleTypeGetNumTypes(MlirType type)
Returns the number of types contained in a tuple.
MLIR_CAPI_EXPORTED MlirType mlirVectorTypeGet(intptr_t rank, const int64_t *shape, MlirType elementType)
Creates a vector type of the shape identified by its rank and dimensions, with the given element type...
MLIR_CAPI_EXPORTED MlirType mlirIntegerTypeUnsignedGet(MlirContext ctx, unsigned bitwidth)
Creates an unsigned integer type of the given bitwidth in the context.
MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat8E4M3FNUZ(MlirType type)
Checks whether the given type is an f8E4M3FNUZ type.
MLIR_CAPI_EXPORTED MlirTypeID mlirBFloat16TypeGetTypeID(void)
Returns the typeID of an BFloat16 type.
MLIR_CAPI_EXPORTED MlirType mlirFloat8E4M3FNTypeGet(MlirContext ctx)
Creates an f8E4M3FN type in the given context.
MLIR_CAPI_EXPORTED bool mlirTypeIsAF32(MlirType type)
Checks whether the given type is an f32 type.
MLIR_CAPI_EXPORTED MlirTypeID mlirRankedTensorTypeGetTypeID(void)
Returns the typeID of an RankedTensor type.
MLIR_CAPI_EXPORTED MlirType mlirFunctionTypeGet(MlirContext ctx, intptr_t numInputs, MlirType const *inputs, intptr_t numResults, MlirType const *results)
Creates a function type, mapping a list of input types to result types.
MLIR_CAPI_EXPORTED bool mlirShapedTypeIsDynamicStrideOrOffset(int64_t val)
Checks whether the given value is used as a placeholder for dynamic strides and offsets in shaped typ...
MLIR_CAPI_EXPORTED MlirType mlirMemRefTypeContiguousGetChecked(MlirLocation loc, MlirType elementType, intptr_t rank, const int64_t *shape, MlirAttribute memorySpace)
Same as "mlirMemRefTypeContiguousGet" but returns a nullptr wrapping MlirType on illegal arguments,...
MLIR_CAPI_EXPORTED MlirType mlirTupleTypeGetType(MlirType type, intptr_t pos)
Returns the pos-th type in the tuple type.
MLIR_CAPI_EXPORTED bool mlirTypeIsARankedTensor(MlirType type)
Checks whether the given type is a ranked tensor type.
MLIR_CAPI_EXPORTED bool mlirVectorTypeIsDimScalable(MlirType type, intptr_t dim)
Checks whether the "dim"-th dimension of the given vector is scalable.
MLIR_CAPI_EXPORTED bool mlirShapedTypeIsDynamicDim(MlirType type, intptr_t dim)
Checks wither the dim-th dimension of the given shaped type is dynamic.
MLIR_CAPI_EXPORTED bool mlirTypeIsATF32(MlirType type)
Checks whether the given type is an TF32 type.
MLIR_CAPI_EXPORTED MlirTypeID mlirComplexTypeGetTypeID(void)
Returns the typeID of an Complex type.
MLIR_CAPI_EXPORTED MlirTypeID mlirIntegerTypeGetTypeID(void)
Returns the typeID of an Integer type.
MLIR_CAPI_EXPORTED MlirTypeID mlirOpaqueTypeGetTypeID(void)
Returns the typeID of an Opaque type.
MLIR_CAPI_EXPORTED MlirTypeID mlirIndexTypeGetTypeID(void)
Returns the typeID of an Index type.
MLIR_CAPI_EXPORTED bool mlirTypeIsAComplex(MlirType type)
Checks whether the given type is a Complex type.
MLIR_CAPI_EXPORTED MlirTypeID mlirUnrankedMemRefTypeGetTypeID(void)
Returns the typeID of an UnrankedMemRef type.
MLIR_CAPI_EXPORTED MlirType mlirUnrankedMemRefTypeGet(MlirType elementType, MlirAttribute memorySpace)
Creates an Unranked MemRef type with the given element type and in the given memory space.
MLIR_CAPI_EXPORTED MlirType mlirMemRefTypeGetChecked(MlirLocation loc, MlirType elementType, intptr_t rank, const int64_t *shape, MlirAttribute layout, MlirAttribute memorySpace)
Same as "mlirMemRefTypeGet" but returns a nullptr-wrapping MlirType o illegal arguments,...
MLIR_CAPI_EXPORTED bool mlirTypeIsABF16(MlirType type)
Checks whether the given type is a bf16 type.
MLIR_CAPI_EXPORTED bool mlirTypeIsAIndex(MlirType type)
Checks whether the given type is an index type.
MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat8E4M3B11FNUZ(MlirType type)
Checks whether the given type is an f8E4M3B11FNUZ type.
MLIR_CAPI_EXPORTED MlirType mlirOpaqueTypeGet(MlirContext ctx, MlirStringRef dialectNamespace, MlirStringRef typeData)
Creates an opaque type in the given context associated with the dialect identified by its namespace.
MLIR_CAPI_EXPORTED intptr_t mlirFunctionTypeGetNumResults(MlirType type)
Returns the number of result types.
MLIR_CAPI_EXPORTED bool mlirShapedTypeIsDynamicSize(int64_t size)
Checks whether the given value is used as a placeholder for dynamic sizes in shaped types.
MLIR_CAPI_EXPORTED bool mlirTypeIsAUnrankedMemRef(MlirType type)
Checks whether the given type is an UnrankedMemRef type.
MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat8E5M2FNUZ(MlirType type)
Checks whether the given type is an f8E5M2FNUZ type.
MLIR_CAPI_EXPORTED bool mlirTypeIsAUnrankedTensor(MlirType type)
Checks whether the given type is an unranked tensor type.
MLIR_CAPI_EXPORTED MlirTypeID mlirFloat32TypeGetTypeID(void)
Returns the typeID of an Float32 type.
MLIR_CAPI_EXPORTED MlirType mlirUnrankedMemRefTypeGetChecked(MlirLocation loc, MlirType elementType, MlirAttribute memorySpace)
Same as "mlirUnrankedMemRefTypeGet" but returns a nullptr wrapping MlirType on illegal arguments,...
MLIR_CAPI_EXPORTED MlirType mlirMemRefTypeGet(MlirType elementType, intptr_t rank, const int64_t *shape, MlirAttribute layout, MlirAttribute memorySpace)
Creates a MemRef type with the given rank and shape, a potentially empty list of affine layout maps,...
MLIR_CAPI_EXPORTED MlirType mlirUnrankedTensorTypeGet(MlirType elementType)
Creates an unranked tensor type with the given element type in the same context as the element type.
MLIR_CAPI_EXPORTED bool mlirVectorTypeIsScalable(MlirType type)
Checks whether the given vector type is scalable, i.e., has at least one scalable dimension.
MLIR_CAPI_EXPORTED MlirType mlirComplexTypeGetElementType(MlirType type)
Returns the element type of the given complex type.
MLIR_CAPI_EXPORTED MlirAttribute mlirUnrankedMemrefGetMemorySpace(MlirType type)
Returns the memory spcae of the given Unranked MemRef type.
MLIR_CAPI_EXPORTED bool mlirTypeIsANone(MlirType type)
Checks whether the given type is a None type.
MLIR_CAPI_EXPORTED int64_t mlirShapedTypeGetDynamicStrideOrOffset(void)
Returns the value indicating a dynamic stride or offset in a shaped type.
MLIR_CAPI_EXPORTED MlirTypeID mlirFunctionTypeGetTypeID(void)
Returns the typeID of an Function type.
MLIR_CAPI_EXPORTED int64_t mlirShapedTypeGetDynamicSize(void)
Returns the value indicating a dynamic size in a shaped type.
MLIR_CAPI_EXPORTED MlirAttribute mlirMemRefTypeGetLayout(MlirType type)
Returns the layout of the given MemRef type.
MLIR_CAPI_EXPORTED MlirType mlirFloat8E4M3B11FNUZTypeGet(MlirContext ctx)
Creates an f8E4M3B11FNUZ type in the given context.
MLIR_CAPI_EXPORTED MlirType mlirTupleTypeGet(MlirContext ctx, intptr_t numElements, MlirType const *elements)
Creates a tuple type that consists of the given list of elemental types.
MLIR_CAPI_EXPORTED MlirTypeID mlirFloat8E4M3B11FNUZTypeGetTypeID(void)
Returns the typeID of an Float8E4M3B11FNUZ type.
MLIR_CAPI_EXPORTED MlirType mlirFloat8E4M3FNUZTypeGet(MlirContext ctx)
Creates an f8E4M3FNUZ type in the given context.
MLIR_CAPI_EXPORTED MlirType mlirFunctionTypeGetResult(MlirType type, intptr_t pos)
Returns the pos-th result type.
MLIR_CAPI_EXPORTED MlirType mlirTF32TypeGet(MlirContext ctx)
Creates a TF32 type in the given context.
#define MLIR_CAPI_EXPORTED
Definition: Support.h:46
A pointer to a sized fragment of a string, not necessarily null-terminated.
Definition: Support.h:73