Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TOSA MLIR Dialect #268

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions mlir/include/mlir/Dialect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ add_subdirectory(SCF)
add_subdirectory(Shape)
add_subdirectory(SPIRV)
add_subdirectory(StandardOps)
add_subdirectory(Tosa)
add_subdirectory(Vector)
2 changes: 2 additions & 0 deletions mlir/include/mlir/Dialect/Tosa/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
add_subdirectory(IR)
add_subdirectory(Transforms)
17 changes: 17 additions & 0 deletions mlir/include/mlir/Dialect/Tosa/IR/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
set(LLVM_TARGET_DEFINITIONS TosaOps.td)
mlir_tablegen(TosaOps.h.inc -gen-op-decls)
mlir_tablegen(TosaOps.cc.inc -gen-op-defs)
add_public_tablegen_target(MLIRTosaOpsIncGen)

set(LLVM_TARGET_DEFINITIONS TosaOps.td)
mlir_tablegen(TosaStructs.h.inc -gen-struct-attr-decls)
mlir_tablegen(TosaStructs.cc.inc -gen-struct-attr-defs)
add_public_tablegen_target(MLIRTosaStructsIncGen)


set(LLVM_TARGET_DEFINITIONS TosaInterfaces.td)
mlir_tablegen(TosaInterfaces.h.inc -gen-op-interface-decls)
mlir_tablegen(TosaInterfaces.cc.inc -gen-op-interface-defs)
add_public_tablegen_target(MLIRTosaInterfaceIncGen)

add_mlir_doc(TosaOps -gen-op-doc TosaOps Dialects/)
34 changes: 34 additions & 0 deletions mlir/include/mlir/Dialect/Tosa/IR/TosaInterfaces.td
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//===-- TosaInterfaces.td - TOSA dialect interfaces *- 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
//
//===----------------------------------------------------------------------===//
//
// This file defines the dialect op interfaces for the TOSA dialect.
//
//===----------------------------------------------------------------------===//

#ifndef TOSA_OP_INTERFACES
#define TOSA_OP_INTERFACES

include "mlir/IR/OpBase.td"

def TosaOpInterface : OpInterface<"TosaOp"> {
let description = [{
Implements interfaces for general Tosa op utility
}];

let methods = [
InterfaceMethod<
[{Returns the TOSA version.}],
"StringRef", "getTOSAVersion", (ins), [{
return "0.20";
}]
>,
];

}

#endif
Loading