MLIR 24.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 a Float8E5M3FNU type.
220
221/// Checks whether the given type is an f8E5M3FNU type.
223
224/// Creates an f8E5M3FNU type in the given context. The type is owned by the
225/// context.
226MLIR_CAPI_EXPORTED MlirType mlirFloat8E5M3FNUTypeGet(MlirContext ctx);
227
229
230/// Returns the typeID of an BFloat16 type.
232
233/// Checks whether the given type is a bf16 type.
234MLIR_CAPI_EXPORTED bool mlirTypeIsABF16(MlirType type);
235
236/// Creates a bf16 type in the given context. The type is owned by the
237/// context.
238MLIR_CAPI_EXPORTED MlirType mlirBF16TypeGet(MlirContext ctx);
239
241
242/// Returns the typeID of an Float16 type.
244
245/// Checks whether the given type is an f16 type.
246MLIR_CAPI_EXPORTED bool mlirTypeIsAF16(MlirType type);
247
248/// Creates an f16 type in the given context. The type is owned by the
249/// context.
250MLIR_CAPI_EXPORTED MlirType mlirF16TypeGet(MlirContext ctx);
251
253
254/// Returns the typeID of an Float32 type.
256
257/// Checks whether the given type is an f32 type.
258MLIR_CAPI_EXPORTED bool mlirTypeIsAF32(MlirType type);
259
260/// Creates an f32 type in the given context. The type is owned by the
261/// context.
262MLIR_CAPI_EXPORTED MlirType mlirF32TypeGet(MlirContext ctx);
263
265
266/// Returns the typeID of an Float64 type.
268
269/// Checks whether the given type is an f64 type.
270MLIR_CAPI_EXPORTED bool mlirTypeIsAF64(MlirType type);
271
272/// Creates a f64 type in the given context. The type is owned by the
273/// context.
274MLIR_CAPI_EXPORTED MlirType mlirF64TypeGet(MlirContext ctx);
275
277
278/// Returns the typeID of a TF32 type.
280
281/// Checks whether the given type is an TF32 type.
282MLIR_CAPI_EXPORTED bool mlirTypeIsATF32(MlirType type);
283
284/// Creates a TF32 type in the given context. The type is owned by the
285/// context.
286MLIR_CAPI_EXPORTED MlirType mlirTF32TypeGet(MlirContext ctx);
287
289
290//===----------------------------------------------------------------------===//
291// None type.
292//===----------------------------------------------------------------------===//
293
294/// Returns the typeID of an None type.
296
297/// Checks whether the given type is a None type.
298MLIR_CAPI_EXPORTED bool mlirTypeIsANone(MlirType type);
299
300/// Creates a None type in the given context. The type is owned by the
301/// context.
302MLIR_CAPI_EXPORTED MlirType mlirNoneTypeGet(MlirContext ctx);
303
305
306//===----------------------------------------------------------------------===//
307// Complex type.
308//===----------------------------------------------------------------------===//
309
310/// Returns the typeID of an Complex type.
312
313/// Checks whether the given type is a Complex type.
314MLIR_CAPI_EXPORTED bool mlirTypeIsAComplex(MlirType type);
315
316/// Creates a complex type with the given element type in the same context as
317/// the element type. The type is owned by the context.
318MLIR_CAPI_EXPORTED MlirType mlirComplexTypeGet(MlirType elementType);
319
321
322/// Returns the element type of the given complex type.
324
325//===----------------------------------------------------------------------===//
326// Shaped type.
327//===----------------------------------------------------------------------===//
328
329/// Checks whether the given type is a Shaped type.
330MLIR_CAPI_EXPORTED bool mlirTypeIsAShaped(MlirType type);
331
332/// Returns the element type of the shaped type.
334
335/// Checks whether the given shaped type is ranked.
336MLIR_CAPI_EXPORTED bool mlirShapedTypeHasRank(MlirType type);
337
338/// Returns the rank of the given ranked shaped type.
340
341/// Checks whether the given shaped type has a static shape.
343
344/// Checks whether the dim-th dimension of the given shaped type is dynamic.
346
347/// Checks whether the dim-th dimension of the given shaped type is static.
349
350/// Returns the dim-th dimension of the given ranked shaped type.
352 intptr_t dim);
353
354/// Checks whether the given value is used as a placeholder for dynamic sizes
355/// in shaped types.
357
358/// Checks whether the given shaped type dimension value is statically-sized.
360
361/// Returns the value indicating a dynamic size in a shaped type. Prefer
362/// mlirShapedTypeIsDynamicSize and mlirShapedTypeIsStaticSize to direct
363/// comparisons with this value.
365
366/// Checks whether the given value is used as a placeholder for dynamic strides
367/// and offsets in shaped types.
369
370/// Checks whether the given dimension value of a stride or an offset is
371/// statically-sized.
373
374/// Returns the value indicating a dynamic stride or offset in a shaped type.
375/// Prefer mlirShapedTypeIsDynamicStrideOrOffset and
376/// mlirShapedTypeIsStaticStrideOrOffset to direct comparisons with this value.
378
379//===----------------------------------------------------------------------===//
380// Vector type.
381//===----------------------------------------------------------------------===//
382
383/// Returns the typeID of an Vector type.
385
386/// Checks whether the given type is a Vector type.
387MLIR_CAPI_EXPORTED bool mlirTypeIsAVector(MlirType type);
388
389/// Creates a vector type of the shape identified by its rank and dimensions,
390/// with the given element type in the same context as the element type. The
391/// type is owned by the context.
393 const int64_t *shape,
394 MlirType elementType);
395
397
398/// Same as "mlirVectorTypeGet" but returns a nullptr wrapping MlirType on
399/// illegal arguments, emitting appropriate diagnostics.
400MLIR_CAPI_EXPORTED MlirType mlirVectorTypeGetChecked(MlirLocation loc,
401 intptr_t rank,
402 const int64_t *shape,
403 MlirType elementType);
404
405/// Creates a scalable vector type with the shape identified by its rank and
406/// dimensions. A subset of dimensions may be marked as scalable via the
407/// corresponding flag list, which is expected to have as many entries as the
408/// rank of the vector. The vector is created in the same context as the element
409/// type.
411 const int64_t *shape,
412 const bool *scalable,
413 MlirType elementType);
414
415/// Same as "mlirVectorTypeGetScalable" but returns a nullptr wrapping MlirType
416/// on illegal arguments, emitting appropriate diagnostics.
418MlirType mlirVectorTypeGetScalableChecked(MlirLocation loc, intptr_t rank,
419 const int64_t *shape,
420 const bool *scalable,
421 MlirType elementType);
422
423/// Checks whether the given vector type is scalable, i.e., has at least one
424/// scalable dimension.
426
427/// Checks whether the "dim"-th dimension of the given vector is scalable.
429 intptr_t dim);
430
431//===----------------------------------------------------------------------===//
432// Ranked / Unranked Tensor type.
433//===----------------------------------------------------------------------===//
434
435/// Checks whether the given type is a Tensor type.
436MLIR_CAPI_EXPORTED bool mlirTypeIsATensor(MlirType type);
437
438/// Returns the typeID of an RankedTensor type.
440
441/// Checks whether the given type is a ranked tensor type.
443
444/// Returns the typeID of an UnrankedTensor type.
446
447/// Checks whether the given type is an unranked tensor type.
449
450/// Creates a tensor type of a fixed rank with the given shape, element type,
451/// and optional encoding in the same context as the element type. The type is
452/// owned by the context. Tensor types without any specific encoding field
453/// should assign mlirAttributeGetNull() to this parameter.
455 const int64_t *shape,
456 MlirType elementType,
457 MlirAttribute encoding);
458
460
461/// Same as "mlirRankedTensorTypeGet" but returns a nullptr wrapping MlirType on
462/// illegal arguments, emitting appropriate diagnostics.
464 MlirLocation loc, intptr_t rank, const int64_t *shape, MlirType elementType,
465 MlirAttribute encoding);
466
467/// Gets the 'encoding' attribute from the ranked tensor type, returning a null
468/// attribute if none.
469MLIR_CAPI_EXPORTED MlirAttribute mlirRankedTensorTypeGetEncoding(MlirType type);
470
471/// Creates an unranked tensor type with the given element type in the same
472/// context as the element type. The type is owned by the context.
473MLIR_CAPI_EXPORTED MlirType mlirUnrankedTensorTypeGet(MlirType elementType);
474
476
477/// Same as "mlirUnrankedTensorTypeGet" but returns a nullptr wrapping MlirType
478/// on illegal arguments, emitting appropriate diagnostics.
479MLIR_CAPI_EXPORTED MlirType
480mlirUnrankedTensorTypeGetChecked(MlirLocation loc, MlirType elementType);
481
482//===----------------------------------------------------------------------===//
483// Ranked / Unranked MemRef type.
484//===----------------------------------------------------------------------===//
485
486/// Returns the typeID of an MemRef type.
488
489/// Checks whether the given type is a MemRef type.
490MLIR_CAPI_EXPORTED bool mlirTypeIsAMemRef(MlirType type);
491
492/// Returns the typeID of an UnrankedMemRef type.
494
495/// Checks whether the given type is an UnrankedMemRef type.
497
498/// Creates a MemRef type with the given rank and shape, a potentially empty
499/// list of affine layout maps, the given memory space and element type, in the
500/// same context as element type. The type is owned by the context.
501MLIR_CAPI_EXPORTED MlirType mlirMemRefTypeGet(MlirType elementType,
502 intptr_t rank,
503 const int64_t *shape,
504 MlirAttribute layout,
505 MlirAttribute memorySpace);
506
508
509/// Same as "mlirMemRefTypeGet" but returns a nullptr-wrapping MlirType o
510/// illegal arguments, emitting appropriate diagnostics.
512 MlirLocation loc, MlirType elementType, intptr_t rank, const int64_t *shape,
513 MlirAttribute layout, MlirAttribute memorySpace);
514
515/// Creates a MemRef type with the given rank, shape, memory space and element
516/// type in the same context as the element type. The type has no affine maps,
517/// i.e. represents a default row-major contiguous memref. The type is owned by
518/// the context.
519MLIR_CAPI_EXPORTED MlirType
520mlirMemRefTypeContiguousGet(MlirType elementType, intptr_t rank,
521 const int64_t *shape, MlirAttribute memorySpace);
522
523/// Same as "mlirMemRefTypeContiguousGet" but returns a nullptr wrapping
524/// MlirType on illegal arguments, emitting appropriate diagnostics.
526 MlirLocation loc, MlirType elementType, intptr_t rank, const int64_t *shape,
527 MlirAttribute memorySpace);
528
529/// Creates an Unranked MemRef type with the given element type and in the given
530/// memory space. The type is owned by the context of element type.
531MLIR_CAPI_EXPORTED MlirType
532mlirUnrankedMemRefTypeGet(MlirType elementType, MlirAttribute memorySpace);
533
535
536/// Same as "mlirUnrankedMemRefTypeGet" but returns a nullptr wrapping
537/// MlirType on illegal arguments, emitting appropriate diagnostics.
539 MlirLocation loc, MlirType elementType, MlirAttribute memorySpace);
540
541/// Returns the layout of the given MemRef type.
542MLIR_CAPI_EXPORTED MlirAttribute mlirMemRefTypeGetLayout(MlirType type);
543
544/// Returns the affine map of the given MemRef type.
545MLIR_CAPI_EXPORTED MlirAffineMap mlirMemRefTypeGetAffineMap(MlirType type);
546
547/// Returns the memory space of the given MemRef type.
548MLIR_CAPI_EXPORTED MlirAttribute mlirMemRefTypeGetMemorySpace(MlirType type);
549
550/// Returns the strides of the MemRef if the layout map is in strided form.
551/// Both strides and offset are out params. strides must point to pre-allocated
552/// memory of length equal to the rank of the memref.
554 MlirType type, int64_t *strides, int64_t *offset);
555
556/// Returns the memory spcae of the given Unranked MemRef type.
557MLIR_CAPI_EXPORTED MlirAttribute
559
560//===----------------------------------------------------------------------===//
561// Tuple type.
562//===----------------------------------------------------------------------===//
563
564/// Returns the typeID of an Tuple type.
566
567/// Checks whether the given type is a tuple type.
568MLIR_CAPI_EXPORTED bool mlirTypeIsATuple(MlirType type);
569
570/// Creates a tuple type that consists of the given list of elemental types. The
571/// type is owned by the context.
572MLIR_CAPI_EXPORTED MlirType mlirTupleTypeGet(MlirContext ctx,
573 intptr_t numElements,
574 MlirType const *elements);
575
577
578/// Returns the number of types contained in a tuple.
580
581/// Returns the pos-th type in the tuple type.
582MLIR_CAPI_EXPORTED MlirType mlirTupleTypeGetType(MlirType type, intptr_t pos);
583
584//===----------------------------------------------------------------------===//
585// Function type.
586//===----------------------------------------------------------------------===//
587
588/// Returns the typeID of an Function type.
590
591/// Checks whether the given type is a function type.
592MLIR_CAPI_EXPORTED bool mlirTypeIsAFunction(MlirType type);
593
594/// Creates a function type, mapping a list of input types to result types.
595MLIR_CAPI_EXPORTED MlirType mlirFunctionTypeGet(MlirContext ctx,
596 intptr_t numInputs,
597 MlirType const *inputs,
598 intptr_t numResults,
599 MlirType const *results);
600
602
603/// Returns the number of input types.
605
606/// Returns the number of result types.
608
609/// Returns the pos-th input type.
610MLIR_CAPI_EXPORTED MlirType mlirFunctionTypeGetInput(MlirType type,
611 intptr_t pos);
612
613/// Returns the pos-th result type.
614MLIR_CAPI_EXPORTED MlirType mlirFunctionTypeGetResult(MlirType type,
615 intptr_t pos);
616
617//===----------------------------------------------------------------------===//
618// Opaque type.
619//===----------------------------------------------------------------------===//
620
621/// Returns the typeID of an Opaque type.
623
624/// Checks whether the given type is an opaque type.
625MLIR_CAPI_EXPORTED bool mlirTypeIsAOpaque(MlirType type);
626
627/// Creates an opaque type in the given context associated with the dialect
628/// identified by its namespace. The type contains opaque byte data of the
629/// specified length (data need not be null-terminated).
630MLIR_CAPI_EXPORTED MlirType mlirOpaqueTypeGet(MlirContext ctx,
631 MlirStringRef dialectNamespace,
632 MlirStringRef typeData);
633
635
636/// Returns the namespace of the dialect with which the given opaque type
637/// is associated. The namespace string is owned by the context.
640
641/// Returns the raw data as a string reference. The data remains live as long as
642/// the context in which the type lives.
644
645#ifdef __cplusplus
646}
647#endif
648
649#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 bool mlirTypeIsAFloat8E5M3FNU(MlirType type)
Checks whether the given type is an f8E5M3FNU type.
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 MlirStringRef mlirFloat8E5M3FNUTypeGetName(void)
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 MlirType mlirFloat8E5M3FNUTypeGet(MlirContext ctx)
Creates an f8E5M3FNU type in the given context.
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 mlirFloat8E5M3FNUTypeGetTypeID(void)
Returns the typeID of a Float8E5M3FNU 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 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:121
A pointer to a sized fragment of a string, not necessarily null-terminated.
Definition Support.h:78