LLZK 0.1.0
An open-source IR for Zero Knowledge (ZK) circuits
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
70 CreateArrayOp, WithMapOperands, MlirType arrType, LlzkAffineMapOperandsBuilder mapOperands
71);
72
73#ifdef __cplusplus
74}
75#endif
76
77#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:48
MLIR_CAPI_EXPORTED intptr_t llzkArrayTypeGetNumDims(MlirType type)
Returns the number of dimensions of an llzk::array::ArrayType.
Definition Array.cpp:58
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:42
MLIR_CAPI_EXPORTED MlirAttribute llzkArrayTypeGetDim(MlirType type, intptr_t dim)
Returns the n-th dimention of an llzk::array::ArrayType.
Definition Array.cpp:62
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:54
#define LLZK_DECLARE_TYPE_ISA(what)
Definition Support.h:48
#define LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD(op, suffix,...)
Definition Support.h:33
Encapsulates the arguments related to affine maps that are common in operation constructors that supp...
Definition Support.h:105