diff --git a/mlir/python/mlir/dialects/CMakeLists.txt b/mlir/python/mlir/dialects/CMakeLists.txt --- a/mlir/python/mlir/dialects/CMakeLists.txt +++ b/mlir/python/mlir/dialects/CMakeLists.txt @@ -45,6 +45,11 @@ DIALECT_NAME tensor) add_dependencies(MLIRBindingsPythonSources MLIRBindingsPythonTensorOps) +add_mlir_dialect_python_bindings(MLIRBindingsPythonTosaOps + TD_FILE TosaOps.td + DIALECT_NAME tosa) +add_dependencies(MLIRBindingsPythonSources MLIRBindingsPythonTosaOps) + add_mlir_dialect_python_bindings(MLIRBindingsPythonVectorOps TD_FILE VectorOps.td DIALECT_NAME vector) diff --git a/mlir/python/mlir/dialects/TosaOps.td b/mlir/python/mlir/dialects/TosaOps.td new file mode 100644 --- /dev/null +++ b/mlir/python/mlir/dialects/TosaOps.td @@ -0,0 +1,15 @@ +//===-- TosaOps.td - Entry point for TosaOps 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 +// +//===----------------------------------------------------------------------===// + +#ifndef PYTHON_BINDINGS_TOSA_OPS +#define PYTHON_BINDINGS_TOSA_OPS + +include "mlir/Bindings/Python/Attributes.td" +include "mlir/Dialect/Tosa/IR/TosaOps.td" + +#endif diff --git a/mlir/python/mlir/dialects/tosa.py b/mlir/python/mlir/dialects/tosa.py new file mode 100644 --- /dev/null +++ b/mlir/python/mlir/dialects/tosa.py @@ -0,0 +1,5 @@ +# 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 + +from ._tosa_ops_gen import * diff --git a/mlir/test/python/dialects/tosa.py b/mlir/test/python/dialects/tosa.py new file mode 100644 --- /dev/null +++ b/mlir/test/python/dialects/tosa.py @@ -0,0 +1,8 @@ +# RUN: %PYTHON %s + +from mlir.ir import * +import mlir.dialects.tosa as tosa + + +# Just make sure the dialect is populated with generated ops. +assert tosa.AddOp