12#include "mlir/Bindings/Python/NanobindAdaptors.h"
15#include "mlir-c/Support.h"
16#include <nanobind/nanobind.h>
21using namespace mlir::python::nanobind_adaptors;
25 m.doc() =
"Seq dialect Python native extension";
30 [](nb::object cls, MlirContext ctx) {
33 nb::arg(
"cls"), nb::arg(
"context") = nb::none());
36 .def_classmethod(
"get",
37 [](nb::object cls, MlirType innerType) {
40 .def_property_readonly(
"inner_type", [](MlirType self) {
47 [](nb::object cls, std::vector<int64_t> shape, MlirType
elementType,
52 nb::arg(
"cls"), nb::arg(
"shape"), nb::arg(
"element_type"),
53 nb::arg(
"context") = nb::none())
54 .def_property_readonly(
57 .def_property_readonly(
59 .def_property_readonly(
"shape", [](MlirType self) {
63 for (intptr_t i = 0; i < rank; ++i)
64 result.append(shapePtr[i]);
71 [](nb::object cls, uint64_t depth, uint32_t width,
72 std::optional<uint32_t> maskWidth, MlirContext ctx) {
73 const uint32_t *maskPtr =
nullptr;
75 if (maskWidth.has_value()) {
76 maskVal = maskWidth.value();
81 nb::arg(
"cls"), nb::arg(
"depth"), nb::arg(
"width"),
82 nb::arg(
"mask_width") = nb::none(), nb::arg(
"context") = nb::none())
83 .def_property_readonly(
85 .def_property_readonly(
87 .def_property_readonly(
"mask_width", [](MlirType self) -> nb::object {
MLIR_CAPI_EXPORTED bool seqTypeIsAClock(MlirType type)
If the type is an clock type.
MLIR_CAPI_EXPORTED MlirType seqImmutableTypeGetInnerType(MlirType type)
Creates a seq immutable type.
MLIR_CAPI_EXPORTED bool seqTypeIsAFirMem(MlirType type)
If the type is a FirMem type.
MLIR_CAPI_EXPORTED uint64_t seqFirMemTypeGetDepth(MlirType type)
Gets the depth of a FirMem type.
MLIR_CAPI_EXPORTED MlirType seqImmutableTypeGet(MlirType type)
Creates a seq immutable type.
MLIR_CAPI_EXPORTED uint32_t seqFirMemTypeGetWidth(MlirType type)
Gets the width of a FirMem type.
MLIR_CAPI_EXPORTED MlirType seqFirMemTypeGet(MlirContext ctx, uint64_t depth, uint32_t width, const uint32_t *maskWidth)
Creates a seq FirMem type.
MLIR_CAPI_EXPORTED MlirType seqHLMemTypeGetElementType(MlirType type)
Gets the element type of an HLMem type.
MLIR_CAPI_EXPORTED bool seqTypeIsAImmutable(MlirType type)
If the type is an immutable type.
MLIR_CAPI_EXPORTED intptr_t seqHLMemTypeGetRank(MlirType type)
Gets the rank of an HLMem type.
MLIR_CAPI_EXPORTED bool seqTypeIsAHLMem(MlirType type)
If the type is a HLMemType.
MLIR_CAPI_EXPORTED bool seqFirMemTypeHasMask(MlirType type)
Returns true if the FirMem type has a mask width defined.
MLIR_CAPI_EXPORTED MlirType seqHLMemTypeGet(MlirContext ctx, intptr_t rank, const int64_t *shape, MlirType elementType)
Creates a seq HLMem type.
MLIR_CAPI_EXPORTED MlirType seqClockTypeGet(MlirContext ctx)
Creates an seq clock type.
MLIR_CAPI_EXPORTED const int64_t * seqHLMemTypeGetShape(MlirType type)
Gets a pointer to the shape array of an HLMem type The array length is equal to the rank.
MLIR_CAPI_EXPORTED uint32_t seqFirMemTypeGetMaskWidth(MlirType type)
Gets the mask width of a FirMem type Behavior is undefined if seqFirMemTypeHasMask returns false.
void populateDialectSeqSubmodule(nanobind::module_ &m)
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.