forked from OSchip/llvm-project
Enable MLIR Python bindings for TOSA.
Differential Revision: https://reviews.llvm.org/D103035
This commit is contained in:
parent
ba51da820e
commit
96aa0a4115
|
@ -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)
|
||||
|
|
|
@ -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
|
|
@ -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 *
|
|
@ -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
|
Loading…
Reference in New Issue