MLIR 22.0.0git
DialectIRDL.cpp
Go to the documentation of this file.
1//===--- DialectIRDL.cpp - Pybind module for IRDL dialect API support ---===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
10#include "mlir-c/IR.h"
11#include "mlir-c/Support.h"
14
15namespace nb = nanobind;
16using namespace mlir;
17using namespace mlir::python;
19
20static void populateDialectIRDLSubmodule(nb::module_ &m) {
21 m.def(
22 "load_dialects",
23 [](MlirModule module) {
25 throw std::runtime_error(
26 "failed to load IRDL dialects from the input module");
27 },
28 nb::arg("module"), "Load IRDL dialects from the given module.");
29}
30
31NB_MODULE(_mlirDialectsIRDL, m) {
32 m.doc() = "MLIR IRDL dialect.";
33
35}
NB_MODULE(_mlirDialectsIRDL, m)
static void populateDialectIRDLSubmodule(nb::module_ &m)
MLIR_CAPI_EXPORTED MlirLogicalResult mlirLoadIRDLDialects(MlirModule module)
Loads all IRDL dialects in the provided module, registering the dialects in the module's associated c...
Definition IRDL.cpp:16
static bool mlirLogicalResultIsFailure(MlirLogicalResult res)
Checks if the given logical result represents a failure.
Definition Support.h:127
Include the generated interface declarations.