LLZK 0.1.0
Veridise's ZK Language IR
Loading...
Searching...
No Matches
Array.h
Go to the documentation of this file.
1//===-- Array.h - C API for Array dialect -------------------------*- C -*-===//
2//
3// Part of the LLZK Project, under the Apache License v2.0.
4// See LICENSE.txt for license information.
5// Copyright 2025 Veridise Inc.
6// SPDX-License-Identifier: Apache-2.0
7//
8//===----------------------------------------------------------------------===//
9//
10// This header declares the C interface for registering and accessing the
11// Array dialect. A dialect should be registered with a context to make it
12// available to users of the context. These users must load the dialect
13// before using any of its attributes, operations, or types. Parser and pass
14// manager can load registered dialects automatically.
15//
16//===----------------------------------------------------------------------===//
17
18#ifndef LLZK_C_DIALECT_ARRAY_H
19#define LLZK_C_DIALECT_ARRAY_H
20
22
23#include "llzk-c/Support.h"
24
25#include <mlir-c/IR.h>
26
27#include <stdint.h>
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
34
35//===----------------------------------------------------------------------===//
36// ArrayType
37//===----------------------------------------------------------------------===//
38
40MLIR_CAPI_EXPORTED MlirType
41llzkArrayTypeGet(MlirType type, intptr_t nDims, MlirAttribute const *dims);
42
45
47MLIR_CAPI_EXPORTED MlirType
48llzkArrayTypeGetWithNumericDims(MlirType type, intptr_t nDims, int64_t const *dims);
49
51MLIR_CAPI_EXPORTED MlirType llzkArrayTypeGetElementType(MlirType type);
52
54MLIR_CAPI_EXPORTED intptr_t llzkArrayTypeGetNumDims(MlirType type);
55
57MLIR_CAPI_EXPORTED MlirAttribute llzkArrayTypeGetDim(MlirType type, intptr_t dim);
58
59//===----------------------------------------------------------------------===//
60// CreateArrayOp
61//===----------------------------------------------------------------------===//
62
65 CreateArrayOp, WithValues, MlirType arrType, intptr_t nValues, MlirValue const *values
66);
67
71 CreateArrayOp, WithMapOperands, MlirType arrType, intptr_t nMapOperands,
72 MlirValueRange const *mapOperands, MlirAttribute dimsPerMap
73);
74
77 CreateArrayOp, WithMapOperandsAndDims, MlirType arrType, intptr_t nMapOperands,
78 MlirValueRange const *mapOperands, intptr_t nDimsPerMap, int32_t const *dimsPerMap
79);
80
81#ifdef __cplusplus
82}
83#endif
84
85#endif
MLIR_CAPI_EXPORTED MlirType llzkArrayTypeGetWithNumericDims(MlirType type, intptr_t nDims, int64_t const *dims)
Creates an llzk::array::ArrayType using a list of numbers as dimensions.
Definition Array.cpp:46
MLIR_CAPI_EXPORTED intptr_t llzkArrayTypeGetNumDims(MlirType type)
Returns the number of dimensions of an llzk::array::ArrayType.
Definition Array.cpp:56
MLIR_CAPI_EXPORTED MlirType llzkArrayTypeGet(MlirType type, intptr_t nDims, MlirAttribute const *dims)
Creates an llzk::array::ArrayType using a list of attributes as dimensions.
Definition Array.cpp:40
MLIR_CAPI_EXPORTED MlirAttribute llzkArrayTypeGetDim(MlirType type, intptr_t dim)
Returns the n-th dimention of an llzk::array::ArrayType.
Definition Array.cpp:60
MLIR_DECLARE_CAPI_DIALECT_REGISTRATION(Array, llzk__array)
MLIR_CAPI_EXPORTED MlirType llzkArrayTypeGetElementType(MlirType type)
Returns the element type of an llzk::array::ArrayType.
Definition Array.cpp:52
#define LLZK_DECLARE_TYPE_ISA(what)
Definition Support.h:47
#define LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD(op, suffix,...)
Definition Support.h:32