2021-09-11 02:44:38 +08:00
|
|
|
//===-- TorchBind.td - Torch dialect bind ------------------*- tablegen -*-===//
|
|
|
|
//
|
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2021-09-30 00:03:40 +08:00
|
|
|
// Also available under a BSD-style license. See LICENSE.
|
2021-09-11 02:44:38 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "mlir-c/Bindings/Python/Interop.h"
|
|
|
|
#include "mlir/Bindings/Python/PybindAdaptors.h"
|
2022-07-21 09:34:17 +08:00
|
|
|
#include "mlir/CAPI/IR.h"
|
2021-09-23 00:55:09 +08:00
|
|
|
#include "torch-mlir-c/Dialects.h"
|
|
|
|
#include "torch-mlir-c/Registration.h"
|
2021-09-11 02:44:38 +08:00
|
|
|
|
|
|
|
namespace py = pybind11;
|
|
|
|
|
|
|
|
PYBIND11_MODULE(_torchMlir, m) {
|
2021-09-23 00:55:09 +08:00
|
|
|
torchMlirRegisterAllPasses();
|
|
|
|
|
2021-09-11 02:44:38 +08:00
|
|
|
m.doc() = "torch-mlir main python extension";
|
|
|
|
|
2022-07-21 09:34:17 +08:00
|
|
|
m.def("register_required_dialects", torchMlirRegisterRequiredDialects,
|
|
|
|
py::arg("context"));
|
2021-09-11 02:44:38 +08:00
|
|
|
}
|