| # Copyright 2022 The IREE Authors |
| # |
| # Licensed 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 |
| |
| load("@llvm-project//mlir:tblgen.bzl", "gentbl_cc_library", "td_library") |
| package(default_visibility = ["//visibility:public"]) |
| |
| licenses(["notice"]) |
| |
| exports_files(["LICENSE"]) |
| |
| ################################################################################ |
| # Tablegen exports |
| ################################################################################ |
| |
| filegroup( |
| name = "TdFilegroup", |
| srcs = glob([ |
| "include/torch-mlir-dialects/Dialect/TMTensor/IR/*.td", |
| ]), |
| ) |
| |
| td_library( |
| name = "TdFiles", |
| srcs = glob([ |
| "include/torch-mlir-dialects/Dialect/TMTensor/IR/*.td", |
| ]), |
| includes = ["include"], |
| deps = [ |
| "@llvm-project//mlir:OpBaseTdFiles", |
| "@llvm-project//mlir:SideEffectInterfacesTdFiles", |
| ], |
| ) |
| |
| ################################################################################ |
| # TMTensor Dialect |
| ################################################################################ |
| |
| gentbl_cc_library( |
| name = "TMTensorIncGen", |
| strip_include_prefix = "include", |
| tbl_outs = [ |
| ( |
| [ |
| "-dialect=tm_tensor", |
| "-gen-dialect-decls", |
| ], |
| "include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorDialect.h.inc", |
| ), |
| ( |
| [ |
| "-dialect=tm_tensor", |
| "-gen-dialect-defs", |
| ], |
| "include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorDialect.cpp.inc", |
| ), |
| ( |
| ["-gen-op-decls"], |
| "include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorOps.h.inc", |
| ), |
| ( |
| ["-gen-op-defs"], |
| "include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorOps.cpp.inc", |
| ), |
| ( |
| ["-gen-typedef-decls"], |
| "include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorTypes.h.inc", |
| ), |
| ( |
| ["-gen-typedef-defs"], |
| "include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorTypes.cpp.inc", |
| ), |
| ], |
| tblgen = "@llvm-project//mlir:mlir-tblgen", |
| td_file = "include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorOps.td", |
| deps = [ |
| ":TdFiles", |
| "@llvm-project//mlir:ControlFlowInterfacesTdFiles", |
| ], |
| ) |
| |
| gentbl_cc_library( |
| name = "TMTensorInterfacesIncGen", |
| strip_include_prefix = "include", |
| tbl_outs = [ |
| ( |
| ["-gen-op-interface-decls"], |
| "include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorOpInterfaces.h.inc", |
| ), |
| ( |
| ["-gen-op-interface-defs"], |
| "include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorOpInterfaces.cpp.inc", |
| ), |
| ( |
| ["-gen-type-interface-decls"], |
| "include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorTypeInterfaces.h.inc", |
| ), |
| ( |
| ["-gen-type-interface-defs"], |
| "include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorTypeInterfaces.cpp.inc", |
| ), |
| ], |
| tblgen = "@llvm-project//mlir:mlir-tblgen", |
| td_file = "include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorInterfaces.td", |
| deps = [ |
| ":TdFiles", |
| ], |
| ) |
| |
| gentbl_cc_library( |
| name = "TMTensorScalarLoopOpInterfacesIncGen", |
| strip_include_prefix = "include", |
| tbl_outs = [ |
| ( |
| ["-gen-op-interface-decls"], |
| "include/torch-mlir-dialects/Dialect/TMTensor/IR/ScalarLoopOpInterface.h.inc", |
| ), |
| ( |
| ["-gen-op-interface-defs"], |
| "include/torch-mlir-dialects/Dialect/TMTensor/IR/ScalarLoopOpInterface.cpp.inc", |
| ), |
| ], |
| tblgen = "@llvm-project//mlir:mlir-tblgen", |
| td_file = "include/torch-mlir-dialects/Dialect/TMTensor/IR/ScalarLoopOpInterface.td", |
| deps = [ |
| ":TdFiles", |
| ], |
| ) |
| |
| cc_library( |
| name = "TorchMLIRTMTensorDialect", |
| srcs = glob([ |
| "lib/Dialect/TMTensor/IR/*.cpp", |
| ]), |
| hdrs = glob([ |
| "include/torch-mlir-dialects/Dialect/TMTensor/IR/*.h", |
| ]), |
| includes = ["include"], |
| deps = [ |
| ":TMTensorIncGen", |
| ":TMTensorInterfacesIncGen", |
| ":TMTensorScalarLoopOpInterfacesIncGen", |
| "@llvm-project//llvm:Support", |
| "@llvm-project//mlir:ControlFlowInterfaces", |
| "@llvm-project//mlir:DialectUtils", |
| "@llvm-project//mlir:IR", |
| "@llvm-project//mlir:LinalgDialect", |
| "@llvm-project//mlir:MemRefDialect", |
| "@llvm-project//mlir:SCFDialect", |
| "@llvm-project//mlir:SideEffectInterfaces", |
| "@llvm-project//mlir:Support", |
| "@llvm-project//mlir:TensorDialect", |
| "@llvm-project//mlir:TensorUtils", |
| ], |
| ) |