MLIR 23.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
18extern "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.
29MLIR_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.
33MLIR_CAPI_EXPORTED MlirType mlirIntegerTypeGet(MlirContext ctx,
34 unsigned bitwidth);
35
37
38/// Creates a signed integer type of the given bitwidth in the context. The type
39/// is owned by the context.
40MLIR_CAPI_EXPORTED MlirType mlirIntegerTypeSignedGet(MlirContext ctx,
41 unsigned bitwidth);
42
43/// Creates an unsigned integer type of the given bitwidth in the context. The
44/// type is owned by the context.
45MLIR_CAPI_EXPORTED MlirType mlirIntegerTypeUnsignedGet(MlirContext ctx,
46 unsigned bitwidth);
47
48/// Returns the bitwidth of an integer type.
49MLIR_CAPI_EXPORTED unsigned mlirIntegerTypeGetWidth(MlirType type);
50
51/// Checks whether the given integer type is signless.
53
54/// Checks whether the given integer type is signed.
56
57/// Checks whether the given integer type is unsigned.
59
60//===----------------------------------------------------------------------===//
61// Index type.
62//===----------------------------------------------------------------------===//
63
64/// Returns the typeID of an Index type.
66
67/// Checks whether the given type is an index type.
68MLIR_CAPI_EXPORTED bool mlirTypeIsAIndex(MlirType type);
69
70/// Creates an index type in the given context. The type is owned by the
71/// context.
72MLIR_CAPI_EXPORTED MlirType mlirIndexTypeGet(MlirContext ctx);
73
75
76//===----------------------------------------------------------------------===//
77// Floating-point types.
78//===----------------------------------------------------------------------===//
79
80/// Checks whether the given type is a floating-point type.
81MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat(MlirType type);
82
83/// Returns the bitwidth of a floating-point type.
84MLIR_CAPI_EXPORTED unsigned mlirFloatTypeGetWidth(MlirType type);
85
86/// Returns the typeID of an Float4E2M1FN type.
88
89/// Checks whether the given type is an f4E2M1FN type.
91
92/// Creates an f4E2M1FN type in the given context. The type is owned by the
93/// context.
94MLIR_CAPI_EXPORTED MlirType mlirFloat4E2M1FNTypeGet(MlirContext ctx);
95
97
98/// Returns the typeID of an Float6E2M3FN type.
100
101/// Checks whether the given type is an f6E2M3FN type.
103
104/// Creates an f6E2M3FN type in the given context. The type is owned by the
105/// context.
106MLIR_CAPI_EXPORTED MlirType mlirFloat6E2M3FNTypeGet(MlirContext ctx);
107
109
110/// Returns the typeID of an Float6E3M2FN type.
112
113/// Checks whether the given type is an f6E3M2FN type.
115
116/// Creates an f6E3M2FN type in the given context. The type is owned by the
117/// context.
118MLIR_CAPI_EXPORTED MlirType mlirFloat6E3M2FNTypeGet(MlirContext ctx);
119
121
122/// Returns the typeID of an Float8E5M2 type.
124
125/// Checks whether the given type is an f8E5M2 type.
126MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat8E5M2(MlirType type);
127
128/// Creates an f8E5M2 type in the given context. The type is owned by the
129/// context.
130MLIR_CAPI_EXPORTED MlirType mlirFloat8E5M2TypeGet(MlirContext ctx);
131
133
134/// Returns the typeID of an Float8E4M3 type.
136
137/// Checks whether the given type is an f8E4M3 type.
138MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat8E4M3(MlirType type);
139
140/// Creates an f8E4M3 type in the given context. The type is owned by the
141/// context.
142MLIR_CAPI_EXPORTED MlirType mlirFloat8E4M3TypeGet(MlirContext ctx);
143
145
146/// Returns the typeID of an Float8E4M3FN type.
148
149/// Checks whether the given type is an f8E4M3FN type.
151
152/// Creates an f8E4M3FN type in the given context. The type is owned by the
153/// context.
154MLIR_CAPI_EXPORTED MlirType mlirFloat8E4M3FNTypeGet(MlirContext ctx);
155
157
158/// Returns the typeID of an Float8E5M2FNUZ type.
160
161/// Checks whether the given type is an f8E5M2FNUZ type.
163
164/// Creates an f8E5M2FNUZ type in the given context. The type is owned by the
165/// context.
166MLIR_CAPI_EXPORTED MlirType mlirFloat8E5M2FNUZTypeGet(MlirContext ctx);
167
169
170/// Returns the typeID of an Float8E4M3FNUZ type.
172
173/// Checks whether the given type is an f8E4M3FNUZ type.
175
176/// Creates an f8E4M3FNUZ type in the given context. The type is owned by the
177/// context.
178MLIR_CAPI_EXPORTED MlirType mlirFloat8E4M3FNUZTypeGet(MlirContext ctx);
179
181
182/// Returns the typeID of an Float8E4M3B11FNUZ type.
184
185/// Checks whether the given type is an f8E4M3B11FNUZ type.
187
188/// Creates an f8E4M3B11FNUZ type in the given context. The type is owned by the
189/// context.
190MLIR_CAPI_EXPORTED MlirType mlirFloat8E4M3B11FNUZTypeGet(MlirContext ctx);
191
193
194/// Returns the typeID of an Float8E3M4 type.
196
197/// Checks whether the given type is an f8E3M4 type.
198MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat8E3M4(MlirType type);
199
200/// Creates an f8E3M4 type in the given context. The type is owned by the
201/// context.
202MLIR_CAPI_EXPORTED MlirType mlirFloat8E3M4TypeGet(MlirContext ctx);
203
205
206/// Returns the typeID of an Float8E8M0FNU type.
208
209/// Checks whether the given type is an f8E8M0FNU type.
211
212/// Creates an f8E8M0FNU type in the given context. The type is owned by the
213/// context.
214MLIR_CAPI_EXPORTED MlirType mlirFloat8E8M0FNUTypeGet(MlirContext ctx);
215
217
218/// Returns the typeID of an BFloat16 type.
220
221/// Checks whether the given type is a bf16 type.
222MLIR_CAPI_EXPORTED bool mlirTypeIsABF16(MlirType type);
223
224/// Creates a bf16 type in the given context. The type is owned by the
225/// context.
226MLIR_CAPI_EXPORTED MlirType mlirBF16TypeGet(MlirContext ctx);
227
229
230/// Returns the typeID of an Float16 type.
232
233/// Checks whether the given type is an f16 type.
234MLIR_CAPI_EXPORTED bool mlirTypeIsAF16(MlirType type);
235
236/// Creates an f16 type in the given context. The type is owned by the
237/// context.
238MLIR_CAPI_EXPORTED MlirType mlirF16TypeGet(MlirContext ctx);
239
241
242/// Returns the typeID of an Float32 type.
244
245/// Checks whether the given type is an f32 type.
246MLIR_CAPI_EXPORTED bool mlirTypeIsAF32(MlirType type);
247
248/// Creates an f32 type in the given context. The type is owned by the
249/// context.
250MLIR_CAPI_EXPORTED MlirType mlirF32TypeGet(MlirContext ctx);
251
253
254/// Returns the typeID of an Float64 type.
256
257/// Checks whether the given type is an f64 type.
258MLIR_CAPI_EXPORTED bool mlirTypeIsAF64(MlirType type);
259
260/// Creates a f64 type in the given context. The type is owned by the
261/// context.
262MLIR_CAPI_EXPORTED MlirType mlirF64TypeGet(MlirContext ctx);
263
265
266/// Returns the typeID of a TF32 type.
268
269/// Checks whether the given type is an TF32 type.
270MLIR_CAPI_EXPORTED bool mlirTypeIsATF32(MlirType type);
271
272/// Creates a TF32 type in the given context. The type is owned by the
273/// context.
274MLIR_CAPI_EXPORTED MlirType mlirTF32TypeGet(MlirContext ctx);
275
277
278//===----------------------------------------------------------------------===//
279// None type.
280//===----------------------------------------------------------------------===//
281
282/// Returns the typeID of an None type.
284
285/// Checks whether the given type is a None type.
286MLIR_CAPI_EXPORTED bool mlirTypeIsANone(MlirType type);
287
288/// Creates a None type in the given context. The type is owned by the
289/// context.
290MLIR_CAPI_EXPORTED MlirType mlirNoneTypeGet(MlirContext ctx);
291
293
294//===----------------------------------------------------------------------===//
295// Complex type.
296//===----------------------------------------------------------------------===//
297
298/// Returns the typeID of an Complex type.
300
301/// Checks whether the given type is a Complex type.
302MLIR_CAPI_EXPORTED bool mlirTypeIsAComplex(MlirType type);
303
304/// Creates a complex type with the given element type in the same context as
305/// the element type. The type is owned by the context.
306MLIR_CAPI_EXPORTED MlirType mlirComplexTypeGet(MlirType elementType);
307
309
310/// Returns the element type of the given complex type.
312
313//===----------------------------------------------------------------------===//
314// Shaped type.
315//===----------------------------------------------------------------------===//
316
317/// Checks whether the given type is a Shaped type.
318MLIR_CAPI_EXPORTED bool mlirTypeIsAShaped(MlirType type);
319
320/// Returns the element type of the shaped type.
322
323/// Checks whether the given shaped type is ranked.
324MLIR_CAPI_EXPORTED bool mlirShapedTypeHasRank(MlirType type);
325
326/// Returns the rank of the given ranked shaped type.
328
329/// Checks whether the given shaped type has a static shape.
331
332/// Checks whether the dim-th dimension of the given shaped type is dynamic.
334
335/// Checks whether the dim-th dimension of the given shaped type is static.
337
338/// Returns the dim-th dimension of the given ranked shaped type.
340 intptr_t dim);
341
342/// Checks whether the given value is used as a placeholder for dynamic sizes
343/// in shaped types.
345
346/// Checks whether the given shaped type dimension value is statically-sized.
348
349/// Returns the value indicating a dynamic size in a shaped type. Prefer
350/// mlirShapedTypeIsDynamicSize and mlirShapedTypeIsStaticSize to direct
351/// comparisons with this value.
353
354/// Checks whether the given value is used as a placeholder for dynamic strides
355/// and offsets in shaped types.
357
358/// Checks whether the given dimension value of a stride or an offset is
359/// statically-sized.
361
362/// Returns the value indicating a dynamic stride or offset in a shaped type.
363/// Prefer mlirShapedTypeIsDynamicStrideOrOffset and
364/// mlirShapedTypeIsStaticStrideOrOffset to direct comparisons with this value.
366
367//===----------------------------------------------------------------------===//
368// Vector type.
369//===----------------------------------------------------------------------===//
370
371/// Returns the typeID of an Vector type.
373
374/// Checks whether the given type is a Vector type.
375MLIR_CAPI_EXPORTED bool mlirTypeIsAVector(MlirType type);
376
377/// Creates a vector type of the shape identified by its rank and dimensions,
378/// with the given element type in the same context as the element type. The
379/// type is owned by the context.
381 const int64_t *shape,
382 MlirType elementType);
383
385
386/// Same as "mlirVectorTypeGet" but returns a nullptr wrapping MlirType on
387/// illegal arguments, emitting appropriate diagnostics.
388MLIR_CAPI_EXPORTED MlirType mlirVectorTypeGetChecked(MlirLocation loc,
389 intptr_t rank,
390 const int64_t *shape,
391 MlirType elementType);
392
393/// Creates a scalable vector type with the shape identified by its rank and
394/// dimensions. A subset of dimensions may be marked as scalable via the
395/// corresponding flag list, which is expected to have as many entries as the
396/// rank of the vector. The vector is created in the same context as the element
397/// type.
399 const int64_t *shape,
400 const bool *scalable,
401 MlirType elementType);
402
403/// Same as "mlirVectorTypeGetScalable" but returns a nullptr wrapping MlirType
404/// on illegal arguments, emitting appropriate diagnostics.
406MlirType mlirVectorTypeGetScalableChecked(MlirLocation loc, intptr_t rank,
407 const int64_t *shape,
408 const bool *scalable,
409 MlirType elementType);
410
411/// Checks whether the given vector type is scalable, i.e., has at least one
412/// scalable dimension.
414
415/// Checks whether the "dim"-th dimension of the given vector is scalable.
417 intptr_t dim);
418
419//===----------------------------------------------------------------------===//
420// Ranked / Unranked Tensor type.
421//===----------------------------------------------------------------------===//
422
423/// Checks whether the given type is a Tensor type.
424MLIR_CAPI_EXPORTED bool mlirTypeIsATensor(MlirType type);
425
426/// Returns the typeID of an RankedTensor type.
428
429/// Checks whether the given type is a ranked tensor type.
431
432/// Returns the typeID of an UnrankedTensor type.
434
435/// Checks whether the given type is an unranked tensor type.
437
438/// Creates a tensor type of a fixed rank with the given shape, element type,
439/// and optional encoding in the same context as the element type. The type is
440/// owned by the context. Tensor types without any specific encoding field
441/// should assign mlirAttributeGetNull() to this parameter.
443 const int64_t *shape,
444 MlirType elementType,
445 MlirAttribute encoding);
446
448
449/// Same as "mlirRankedTensorTypeGet" but returns a nullptr wrapping MlirType on
450/// illegal arguments, emitting appropriate diagnostics.
452 MlirLocation loc, intptr_t rank, const int64_t *shape, MlirType elementType,
453 MlirAttribute encoding);
454
455/// Gets the 'encoding' attribute from the ranked tensor type, returning a null
456/// attribute if none.
457MLIR_CAPI_EXPORTED MlirAttribute mlirRankedTensorTypeGetEncoding(MlirType type);
458
459/// Creates an unranked tensor type with the given element type in the same
460/// context as the element type. The type is owned by the context.
461MLIR_CAPI_EXPORTED MlirType mlirUnrankedTensorTypeGet(MlirType elementType);
462
464
465/// Same as "mlirUnrankedTensorTypeGet" but returns a nullptr wrapping MlirType
466/// on illegal arguments, emitting appropriate diagnostics.
467MLIR_CAPI_EXPORTED MlirType
468mlirUnrankedTensorTypeGetChecked(MlirLocation loc, MlirType elementType);
469
470//===----------------------------------------------------------------------===//
471// Ranked / Unranked MemRef type.
472//===----------------------------------------------------------------------===//
473
474/// Returns the typeID of an MemRef type.
476
477/// Checks whether the given type is a MemRef type.
478MLIR_CAPI_EXPORTED bool mlirTypeIsAMemRef(MlirType type);
479
480/// Returns the typeID of an UnrankedMemRef type.
482
483/// Checks whether the given type is an UnrankedMemRef type.
485
486/// Creates a MemRef type with the given rank and shape, a potentially empty
487/// list of affine layout maps, the given memory space and element type, in the
488/// same context as element type. The type is owned by the context.
489MLIR_CAPI_EXPORTED MlirType mlirMemRefTypeGet(MlirType elementType,
490 intptr_t rank,
491 const int64_t *shape,
492 MlirAttribute layout,
493 MlirAttribute memorySpace);
494
496
497/// Same as "mlirMemRefTypeGet" but returns a nullptr-wrapping MlirType o
498/// illegal arguments, emitting appropriate diagnostics.
500 MlirLocation loc, MlirType elementType, intptr_t rank, const int64_t *shape,
501 MlirAttribute layout, MlirAttribute memorySpace);
502
503/// Creates a MemRef type with the given rank, shape, memory space and element
504/// type in the same context as the element type. The type has no affine maps,
505/// i.e. represents a default row-major contiguous memref. The type is owned by
506/// the context.
507MLIR_CAPI_EXPORTED MlirType
508mlirMemRefTypeContiguousGet(MlirType elementType, intptr_t rank,
509 const int64_t *shape, MlirAttribute memorySpace);
510
511/// Same as "mlirMemRefTypeContiguousGet" but returns a nullptr wrapping
512/// MlirType on illegal arguments, emitting appropriate diagnostics.
514 MlirLocation loc, MlirType elementType, intptr_t rank, const int64_t *shape,
515 MlirAttribute memorySpace);
516
517/// Creates an Unranked MemRef type with the given element type and in the given
518/// memory space. The type is owned by the context of element type.
519MLIR_CAPI_EXPORTED MlirType
520mlirUnrankedMemRefTypeGet(MlirType elementType, MlirAttribute memorySpace);
521
523
524/// Same as "mlirUnrankedMemRefTypeGet" but returns a nullptr wrapping
525/// MlirType on illegal arguments, emitting appropriate diagnostics.
527 MlirLocation loc, MlirType elementType, MlirAttribute memorySpace);
528
529/// Returns the layout of the given MemRef type.
530MLIR_CAPI_EXPORTED MlirAttribute mlirMemRefTypeGetLayout(MlirType type);
531
532/// Returns the affine map of the given MemRef type.
533MLIR_CAPI_EXPORTED MlirAffineMap mlirMemRefTypeGetAffineMap(MlirType type);
534
535/// Returns the memory space of the given MemRef type.
536MLIR_CAPI_EXPORTED MlirAttribute mlirMemRefTypeGetMemorySpace(MlirType type);
537
538/// Returns the strides of the MemRef if the layout map is in strided form.
539/// Both strides and offset are out params. strides must point to pre-allocated
540/// memory of length equal to the rank of the memref.
542 MlirType type, int64_t *strides, int64_t *offset);
543
544/// Returns the memory spcae of the given Unranked MemRef type.
545MLIR_CAPI_EXPORTED MlirAttribute
547
548//===----------------------------------------------------------------------===//
549// Tuple type.
550//===----------------------------------------------------------------------===//
551
552/// Returns the typeID of an Tuple type.
554
555/// Checks whether the given type is a tuple type.
556MLIR_CAPI_EXPORTED bool mlirTypeIsATuple(MlirType type);
557
558/// Creates a tuple type that consists of the given list of elemental types. The
559/// type is owned by the context.
560MLIR_CAPI_EXPORTED MlirType mlirTupleTypeGet(MlirContext ctx,
561 intptr_t numElements,
562 MlirType const *elements);
563
565
566/// Returns the number of types contained in a tuple.
568
569/// Returns the pos-th type in the tuple type.
570MLIR_CAPI_EXPORTED MlirType mlirTupleTypeGetType(MlirType type, intptr_t pos);
571
572//===----------------------------------------------------------------------===//
573// Function type.
574//===----------------------------------------------------------------------===//
575
576/// Returns the typeID of an Function type.
578
579/// Checks whether the given type is a function type.
580MLIR_CAPI_EXPORTED bool mlirTypeIsAFunction(MlirType type);
581
582/// Creates a function type, mapping a list of input types to result types.
583MLIR_CAPI_EXPORTED MlirType mlirFunctionTypeGet(MlirContext ctx,
584 intptr_t numInputs,
585 MlirType const *inputs,
586 intptr_t numResults,
587 MlirType const *results);
588
590
591/// Returns the number of input types.
593
594/// Returns the number of result types.
596
597/// Returns the pos-th input type.
598MLIR_CAPI_EXPORTED MlirType mlirFunctionTypeGetInput(MlirType type,
599 intptr_t pos);
600
601/// Returns the pos-th result type.
602MLIR_CAPI_EXPORTED MlirType mlirFunctionTypeGetResult(MlirType type,
603 intptr_t pos);
604
605//===----------------------------------------------------------------------===//
606// Opaque type.
607//===----------------------------------------------------------------------===//
608
609/// Returns the typeID of an Opaque type.
611
612/// Checks whether the given type is an opaque type.
613MLIR_CAPI_EXPORTED bool mlirTypeIsAOpaque(MlirType type);
614
615/// Creates an opaque type in the given context associated with the dialect
616/// identified by its namespace. The type contains opaque byte data of the
617/// specified length (data need not be null-terminated).
618MLIR_CAPI_EXPORTED MlirType mlirOpaqueTypeGet(MlirContext ctx,
619 MlirStringRef dialectNamespace,
620 MlirStringRef typeData);
621
623
624/// Returns the namespace of the dialect with which the given opaque type
625/// is associated. The namespace string is owned by the context.
628
629/// Returns the raw data as a string reference. The data remains live as long as
630/// the context in which the type lives.
632
633#ifdef __cplusplus
634}
635#endif
636
637#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 MlirTypeID mlirFloat8E8M0FNUTypeGetTypeID(void)
Returns the typeID of an Float8E8M0FNU type.
MLIR_CAPI_EXPORTED MlirStringRef mlirF64TypeGetName(void)
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 MlirStringRef mlirUnrankedTensorTypeGetName(void)
MLIR_CAPI_EXPORTED unsigned mlirFloatTypeGetWidth(MlirType type)
Returns the bitwidth of a floating-point type.
MLIR_CAPI_EXPORTED MlirTypeID mlirFloat4E2M1FNTypeGetTypeID(void)
Returns the typeID of an Float4E2M1FN 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 bool mlirTypeIsAFloat8E8M0FNU(MlirType type)
Checks whether the given type is an f8E8M0FNU type.
MLIR_CAPI_EXPORTED MlirTypeID mlirNoneTypeGetTypeID(void)
Returns the typeID of an None type.
MLIR_CAPI_EXPORTED MlirStringRef mlirMemRefTypeGetName(void)
MLIR_CAPI_EXPORTED MlirTypeID mlirFloat8E4M3FNUZTypeGetTypeID(void)
Returns the typeID of an Float8E4M3FNUZ type.
MLIR_CAPI_EXPORTED MlirStringRef mlirFloat8E4M3B11FNUZTypeGetName(void)
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 MlirStringRef mlirBF16TypeGetName(void)
MLIR_CAPI_EXPORTED MlirTypeID mlirVectorTypeGetTypeID(void)
Returns the typeID of an Vector type.
MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat6E3M2FN(MlirType type)
Checks whether the given type is an f6E3M2FN type.
MLIR_CAPI_EXPORTED bool mlirShapedTypeIsStaticDim(MlirType type, intptr_t dim)
Checks whether the dim-th dimension of the given shaped type is static.
MLIR_CAPI_EXPORTED bool mlirTypeIsAFunction(MlirType type)
Checks whether the given type is a function type.
MLIR_CAPI_EXPORTED MlirType mlirFloat8E3M4TypeGet(MlirContext ctx)
Creates an f8E3M4 type in the given context.
MLIR_CAPI_EXPORTED MlirStringRef mlirFloat8E4M3FNTypeGetName(void)
MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat8E3M4(MlirType type)
Checks whether the given type is an f8E3M4 type.
MLIR_CAPI_EXPORTED MlirStringRef mlirF16TypeGetName(void)
MLIR_CAPI_EXPORTED bool mlirShapedTypeIsStaticStrideOrOffset(int64_t val)
Checks whether the given dimension value of a stride or an offset is statically-sized.
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 MlirType mlirFloat8E8M0FNUTypeGet(MlirContext ctx)
Creates an f8E8M0FNU type in the given context.
MLIR_CAPI_EXPORTED MlirStringRef mlirIntegerTypeGetName(void)
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 MlirStringRef mlirNoneTypeGetName(void)
MLIR_CAPI_EXPORTED MlirStringRef mlirUnrankedMemRefTypeGetName(void)
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 bool mlirTypeIsAFloat8E4M3(MlirType type)
Checks whether the given type is an f8E4M3 type.
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 MlirStringRef mlirFloat6E3M2FNTypeGetName(void)
MLIR_CAPI_EXPORTED bool mlirTypeIsAF64(MlirType type)
Checks whether the given type is an f64 type.
MLIR_CAPI_EXPORTED MlirType mlirFloat6E2M3FNTypeGet(MlirContext ctx)
Creates an f6E2M3FN type in the given context.
MLIR_CAPI_EXPORTED bool mlirTypeIsAF16(MlirType type)
Checks whether the given type is an f16 type.
MLIR_CAPI_EXPORTED MlirStringRef mlirOpaqueTypeGetName(void)
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 MlirStringRef mlirF32TypeGetName(void)
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 MlirStringRef mlirFloat8E5M2TypeGetName(void)
MLIR_CAPI_EXPORTED intptr_t mlirFunctionTypeGetNumInputs(MlirType type)
Returns the number of input types.
MLIR_CAPI_EXPORTED MlirStringRef mlirComplexTypeGetName(void)
MLIR_CAPI_EXPORTED MlirTypeID mlirFloat8E5M2TypeGetTypeID(void)
Returns the typeID of an Float8E5M2 type.
MLIR_CAPI_EXPORTED MlirStringRef mlirRankedTensorTypeGetName(void)
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 MlirStringRef mlirTupleTypeGetName(void)
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 MlirStringRef mlirFloat4E2M1FNTypeGetName(void)
MLIR_CAPI_EXPORTED MlirType mlirFloat8E4M3TypeGet(MlirContext ctx)
Creates an f8E4M3 type in the given context.
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 MlirTypeID mlirFloat6E2M3FNTypeGetTypeID(void)
Returns the typeID of an Float6E2M3FN 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 mlirTypeIsAFloat6E2M3FN(MlirType type)
Checks whether the given type is an f6E2M3FN type.
MLIR_CAPI_EXPORTED MlirStringRef mlirVectorTypeGetName(void)
MLIR_CAPI_EXPORTED MlirLogicalResult mlirMemRefTypeGetStridesAndOffset(MlirType type, int64_t *strides, int64_t *offset)
Returns the strides of the MemRef if the layout map is in strided form.
MLIR_CAPI_EXPORTED MlirTypeID mlirFloat8E3M4TypeGetTypeID(void)
Returns the typeID of an Float8E3M4 type.
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 bool mlirTypeIsAFloat(MlirType type)
Checks whether the given type is a floating-point 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 MlirStringRef mlirTF32TypeGetName(void)
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 MlirStringRef mlirFloat8E4M3FNUZTypeGetName(void)
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 MlirStringRef mlirFloat8E4M3TypeGetName(void)
MLIR_CAPI_EXPORTED MlirType mlirTupleTypeGetType(MlirType type, intptr_t pos)
Returns the pos-th type in the tuple type.
MLIR_CAPI_EXPORTED MlirStringRef mlirFloat8E5M2FNUZTypeGetName(void)
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 whether 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 MlirStringRef mlirIndexTypeGetName(void)
MLIR_CAPI_EXPORTED MlirTypeID mlirIntegerTypeGetTypeID(void)
Returns the typeID of an Integer type.
MLIR_CAPI_EXPORTED MlirType mlirFloat6E3M2FNTypeGet(MlirContext ctx)
Creates an f6E3M2FN type in the given context.
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 MlirStringRef mlirFloat8E8M0FNUTypeGetName(void)
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 MlirStringRef mlirFloat6E2M3FNTypeGetName(void)
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 MlirStringRef mlirFloat8E3M4TypeGetName(void)
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 MlirStringRef mlirFunctionTypeGetName(void)
MLIR_CAPI_EXPORTED MlirTypeID mlirFloat8E4M3TypeGetTypeID(void)
Returns the typeID of an Float8E4M3 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 bool mlirShapedTypeIsStaticSize(int64_t size)
Checks whether the given shaped type dimension value is statically-sized.
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 bool mlirTypeIsAFloat4E2M1FN(MlirType type)
Checks whether the given type is an f4E2M1FN type.
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 MlirTypeID mlirFloat6E3M2FNTypeGetTypeID(void)
Returns the typeID of an Float6E3M2FN type.
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.
MLIR_CAPI_EXPORTED MlirType mlirFloat4E2M1FNTypeGet(MlirContext ctx)
Creates an f4E2M1FN type in the given context.
#define MLIR_CAPI_EXPORTED
Definition Support.h:46
A logical result value, essentially a boolean with named states.
Definition Support.h:118
A pointer to a sized fragment of a string, not necessarily null-terminated.
Definition Support.h:75