From 05c549f1122e0a25022f6a10e894e333738e14bc Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Wed, 12 Feb 2025 12:43:56 -0600 Subject: [PATCH] review-comment Signed-off-by: Benoit Jacob --- lib/CMakeLists.txt | 2 +- lib/Dialect/TorchConversion/Transforms/Passes.cpp | 11 +++++------ lib/InitAll.cpp | 7 ++++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index fdcad08ddfbb..7f0924b143f4 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -35,7 +35,7 @@ if(TORCH_MLIR_ENABLE_STABLEHLO) list(APPEND LinkedLibs StablehloLinalgTransforms StablehloPasses) endif() -if (TORCH_MLIR_ENABLE_TOSA) +if(TORCH_MLIR_ENABLE_TOSA) list(APPEND LinkedLibs MLIRTosaDialect) endif() diff --git a/lib/Dialect/TorchConversion/Transforms/Passes.cpp b/lib/Dialect/TorchConversion/Transforms/Passes.cpp index f7833d5d3ff9..f9ae92ced13c 100644 --- a/lib/Dialect/TorchConversion/Transforms/Passes.cpp +++ b/lib/Dialect/TorchConversion/Transforms/Passes.cpp @@ -18,22 +18,21 @@ #include "torch-mlir/Conversion/TorchToSCF/TorchToSCF.h" #include "torch-mlir/Conversion/TorchToTMTensor/TorchToTMTensor.h" #include "torch-mlir/Conversion/TorchToTensor/TorchToTensor.h" -#ifdef TORCH_MLIR_ENABLE_TOSA -#include "torch-mlir/Conversion/TorchToTosa/TorchToTosa.h" -#endif #include "torch-mlir/Dialect/Torch/Transforms/Passes.h" + #ifdef TORCH_MLIR_ENABLE_STABLEHLO #include "stablehlo/transforms/Passes.h" #include "torch-mlir/Conversion/TorchToStablehlo/TorchToStablehlo.h" #endif -#include "torch-mlir/Dialect/Torch/Transforms/Passes.h" -using namespace mlir; -using namespace mlir::torch; #ifdef TORCH_MLIR_ENABLE_TOSA +#include "torch-mlir/Conversion/TorchToTosa/TorchToTosa.h" using namespace mlir::tosa; #endif +using namespace mlir; +using namespace mlir::torch; + //===----------------------------------------------------------------------===// // Pass registration //===----------------------------------------------------------------------===// diff --git a/lib/InitAll.cpp b/lib/InitAll.cpp index dfa93a350df1..d9096929e3bb 100644 --- a/lib/InitAll.cpp +++ b/lib/InitAll.cpp @@ -19,9 +19,6 @@ #include "mlir/Dialect/SparseTensor/IR/SparseTensor.h" #include "mlir/Dialect/Tensor/IR/Tensor.h" #include "mlir/Dialect/Tensor/IR/TensorInferTypeOpInterfaceImpl.h" -#ifdef TORCH_MLIR_ENABLE_TOSA -#include "mlir/Dialect/Tosa/IR/TosaOps.h" -#endif #include "mlir/IR/Dialect.h" #include "torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorDialect.h" #include "torch-mlir-dialects/Dialect/TMTensor/Transforms/Passes.h" @@ -38,6 +35,10 @@ #include "stablehlo/transforms/Passes.h" #endif +#ifdef TORCH_MLIR_ENABLE_TOSA +#include "mlir/Dialect/Tosa/IR/TosaOps.h" +#endif + void mlir::torch::registerAllDialects(mlir::DialectRegistry ®istry) { registry.insert(); registry.insert();