LLZK 2.0.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
21#include "llzk-c/Support.h"
22
23#include <mlir-c/IR.h>
24
25#include <stdint.h>
26
27// Include the generated CAPI
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
38
39//===----------------------------------------------------------------------===//
40// ArrayType
41//===----------------------------------------------------------------------===//
42
44MLIR_CAPI_EXPORTED MlirType
45llzkArray_ArrayTypeGetWithDims(MlirType type, intptr_t nDims, MlirAttribute const *dims);
46
48MLIR_CAPI_EXPORTED MlirType
49llzkArray_ArrayTypeGetWithShape(MlirType type, intptr_t nDims, int64_t const *dims);
50
52MLIR_CAPI_EXPORTED MlirType llzkArray_ArrayTypeGetElementType(MlirType type);
53
54//===----------------------------------------------------------------------===//
55// CreateArrayOp
56//===----------------------------------------------------------------------===//
57
60 Array, CreateArrayOp, WithValues, MlirType arrType, intptr_t nValues, MlirValue const *values
61);
62
65 Array, CreateArrayOp, WithMapOperands, MlirType arrType,
67);
68
69#ifdef __cplusplus
70}
71#endif
72
73#endif // LLZK_C_DIALECT_ARRAY_H
MLIR_CAPI_EXPORTED MlirType llzkArray_ArrayTypeGetElementType(MlirType type)
Returns the element type of an llzk::array::ArrayType.
MLIR_CAPI_EXPORTED MlirType llzkArray_ArrayTypeGetWithShape(MlirType type, intptr_t nDims, int64_t const *dims)
Creates an llzk::array::ArrayType using a list of numbers as dimensions.
Definition Array.cpp:52
MLIR_CAPI_EXPORTED MlirType llzkArray_ArrayTypeGetWithDims(MlirType type, intptr_t nDims, MlirAttribute const *dims)
Creates an llzk::array::ArrayType using a list of attributes as dimensions.
Definition Array.cpp:46
MLIR_DECLARE_CAPI_DIALECT_REGISTRATION(Array, llzk__array)
Get reference to the LLZK array dialect.
#define LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD(dialect, op, suffix,...)
Definition Support.h:33
Encapsulates the arguments related to affine maps that are common in operation constructors that supp...
Definition Support.h:103