Enable MLIR Python bindings for TOSA.

Differential Revision: https://reviews.llvm.org/D103035
This commit is contained in:
Stella Laurenzo 2021-05-24 16:41:38 +00:00
parent ba51da820e
commit 96aa0a4115
4 changed files with 33 additions and 0 deletions

View File

@ -45,6 +45,11 @@ add_mlir_dialect_python_bindings(MLIRBindingsPythonTensorOps
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)

View File

@ -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

View File

@ -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 *

View File

@ -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