diff --git a/build_tools/autogen_ltc_backend.py b/build_tools/autogen_ltc_backend.py index 2b4c07cf76b3..f18af385c41b 100644 --- a/build_tools/autogen_ltc_backend.py +++ b/build_tools/autogen_ltc_backend.py @@ -34,7 +34,8 @@ try: from yaml import CSafeLoader as Loader except ImportError: - from yaml import SafeLoader as Loader #type:ignore[assignment, misc] + from yaml import SafeLoader as Loader # type:ignore[assignment, misc] + def reindent(text, prefix=""): return indent(dedent(text), prefix) diff --git a/utils/bazel/torch-mlir-overlay/BUILD.bazel b/utils/bazel/torch-mlir-overlay/BUILD.bazel index fc2c4b1c6ac1..fdde0d63481a 100644 --- a/utils/bazel/torch-mlir-overlay/BUILD.bazel +++ b/utils/bazel/torch-mlir-overlay/BUILD.bazel @@ -278,6 +278,7 @@ gentbl_cc_library( [ "-gen-pass-decls", "-DTORCH_MLIR_ENABLE_STABLEHLO", + "-DTORCH_MLIR_ENABLE_TOSA", ], "include/torch-mlir/Conversion/Passes.h.inc", ), @@ -334,6 +335,7 @@ gentbl_cc_library( [ "-gen-pass-decls", "-DTORCH_MLIR_ENABLE_STABLEHLO", + "-DTORCH_MLIR_ENABLE_TOSA", ], "include/torch-mlir/Dialect/TorchConversion/Transforms/Passes.h.inc", ), @@ -542,6 +544,7 @@ cc_library( ], defines = [ "TORCH_MLIR_ENABLE_STABLEHLO", + "TORCH_MLIR_ENABLE_TOSA", ], strip_include_prefix = "include", deps = [ @@ -566,6 +569,7 @@ cc_library( hdrs = glob(["include/torch-mlir/Dialect/TorchConversion/Transforms/*.h"]), defines = [ "TORCH_MLIR_ENABLE_STABLEHLO", + "TORCH_MLIR_ENABLE_TOSA", ], strip_include_prefix = "include", deps = [ @@ -600,6 +604,9 @@ cc_library( "lib/Conversion/TorchToTosa/*.cpp", ]), hdrs = glob(["include/torch-mlir/Conversion/TorchToTosa/*.h"]), + defines = [ + "TORCH_MLIR_ENABLE_TOSA", + ], strip_include_prefix = "include", deps = [ ":TorchMLIRConversionPassesIncGen", @@ -887,6 +894,7 @@ cc_library( copts = [ "-DTORCH_MLIR_ENABLE_REFBACKEND", "-DTORCH_MLIR_ENABLE_STABLEHLO", + "-DTORCH_MLIR_ENABLE_TOSA", ], strip_include_prefix = "include", deps = [