mirror of https://github.com/llvm/torch-mlir
Move most python sources to the include and lib tree.
parent
b21b5322f6
commit
213041449f
|
@ -6,6 +6,9 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef NPCOMP_PYTHON_MLIRINIT_H
|
||||
#define NPCOMP_PYTHON_MLIRINIT_H
|
||||
|
||||
#include "mlir/Support/LogicalResult.h"
|
||||
#include "llvm/ADT/StringRef.h"
|
||||
|
||||
|
@ -14,7 +17,6 @@
|
|||
// here for parts of the code that are not RTTI-compatible.
|
||||
|
||||
namespace mlir {
|
||||
|
||||
namespace npcomp {
|
||||
namespace python {
|
||||
|
||||
|
@ -24,3 +26,5 @@ bool npcompMlirInitialize();
|
|||
} // namespace python
|
||||
} // namespace npcomp
|
||||
} // namespace mlir
|
||||
|
||||
#endif // NPCOMP_PYTHON_MLIRINIT_H
|
|
@ -6,8 +6,8 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef NPCOMP_PYTHON_NATIVE_MLIR_IR_H
|
||||
#define NPCOMP_PYTHON_NATIVE_MLIR_IR_H
|
||||
#ifndef NPCOMP_PYTHON_MLIR_IR_H
|
||||
#define NPCOMP_PYTHON_MLIR_IR_H
|
||||
|
||||
#include "PybindUtils.h"
|
||||
|
||||
|
@ -198,4 +198,4 @@ protected:
|
|||
|
||||
} // namespace mlir
|
||||
|
||||
#endif // NPCOMP_PYTHON_NATIVE_MLIR_IR_H
|
||||
#endif // NPCOMP_PYTHON_MLIR_IR_H
|
|
@ -6,8 +6,8 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef NPCOMP_PYTHON_NATIVE_MLIR_PASS_H
|
||||
#define NPCOMP_PYTHON_NATIVE_MLIR_PASS_H
|
||||
#ifndef NPCOMP_PYTHON_MLIR_PASS_H
|
||||
#define NPCOMP_PYTHON_MLIR_PASS_H
|
||||
|
||||
#include "MlirIr.h"
|
||||
#include "PybindUtils.h"
|
||||
|
@ -29,4 +29,4 @@ private:
|
|||
|
||||
} // namespace mlir
|
||||
|
||||
#endif // NPCOMP_PYTHON_NATIVE_MLIR_PASS_H
|
||||
#endif // NPCOMP_PYTHON_MLIR_PASS_H
|
|
@ -6,8 +6,8 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef NPCOMP_PYTHON_NATIVE_NPCOMP_MODULE_H
|
||||
#define NPCOMP_PYTHON_NATIVE_NPCOMP_MODULE_H
|
||||
#ifndef NPCOMP_PYTHON_NPCOMP_MODULE_H
|
||||
#define NPCOMP_PYTHON_NPCOMP_MODULE_H
|
||||
|
||||
#include "PybindUtils.h"
|
||||
|
||||
|
@ -25,4 +25,4 @@ void defineNpcompDialect(py::module m);
|
|||
} // namespace npcomp
|
||||
} // namespace mlir
|
||||
|
||||
#endif // NPCOMP_PYTHON_NATIVE_NPCOMP_MODULE_H
|
||||
#endif // NPCOMP_PYTHON_NPCOMP_MODULE_H
|
|
@ -6,8 +6,8 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef NPCOMP_PYTHON_NATIVE_PYBIND_UTILS_H
|
||||
#define NPCOMP_PYTHON_NATIVE_PYBIND_UTILS_H
|
||||
#ifndef NPCOMP_PYTHON_PYBIND_UTILS_H
|
||||
#define NPCOMP_PYTHON_PYBIND_UTILS_H
|
||||
|
||||
#include <string>
|
||||
|
||||
|
@ -52,4 +52,4 @@ inline pybind11::error_already_set raiseValueError(const std::string &message) {
|
|||
|
||||
} // namespace pybind11
|
||||
|
||||
#endif // NPCOMP_PYTHON_NATIVE_PYBIND_UTILS_H
|
||||
#endif // NPCOMP_PYTHON_PYBIND_UTILS_H
|
|
@ -1,6 +1,7 @@
|
|||
add_subdirectory(Conversion)
|
||||
add_subdirectory(Dialect)
|
||||
add_subdirectory(E2E)
|
||||
add_subdirectory(Python)
|
||||
|
||||
################################################################################
|
||||
# Setup the initialization target.
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
add_library(NPCOMPPythonCommon
|
||||
MlirInit.cpp
|
||||
MlirIr.cpp
|
||||
MlirPass.cpp
|
||||
NpcompDialect.cpp
|
||||
PybindUtils.cpp
|
||||
CoreDialects.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(NPCOMPPythonCommon
|
||||
pybind11::module
|
||||
|
||||
NPCOMPInitAll
|
||||
|
||||
# Core dialects
|
||||
MLIRSCF
|
||||
|
||||
# Upstream depends
|
||||
LLVMSupport
|
||||
MLIRDialect
|
||||
MLIREDSC
|
||||
MLIREDSCInterface
|
||||
MLIRIR
|
||||
MLIRLLVMIR
|
||||
MLIRPass
|
||||
MLIRTransforms
|
||||
)
|
|
@ -6,8 +6,8 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "MlirIr.h"
|
||||
#include "NpcompModule.h"
|
||||
#include "npcomp/Python/MlirIr.h"
|
||||
#include "npcomp/Python/NpcompModule.h"
|
||||
|
||||
#include "mlir/Dialect/SCF/SCF.h"
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "MlirInit.h"
|
||||
#include "npcomp/Python/MlirInit.h"
|
||||
|
||||
#include "mlir/IR/Dialect.h"
|
||||
#include "mlir/InitAllDialects.h"
|
|
@ -6,8 +6,8 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "MlirIr.h"
|
||||
#include "NpcompModule.h"
|
||||
#include "npcomp/Python/MlirIr.h"
|
||||
#include "npcomp/Python/NpcompModule.h"
|
||||
|
||||
#include "mlir/Dialect/StandardOps/IR/Ops.h"
|
||||
#include "mlir/IR/Attributes.h"
|
|
@ -6,9 +6,9 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "MlirPass.h"
|
||||
#include "MlirInit.h"
|
||||
#include "NpcompModule.h"
|
||||
#include "npcomp/Python/MlirPass.h"
|
||||
#include "npcomp/Python/MlirInit.h"
|
||||
#include "npcomp/Python/NpcompModule.h"
|
||||
|
||||
#include "mlir/Pass/PassRegistry.h"
|
||||
|
|
@ -6,8 +6,8 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "MlirIr.h"
|
||||
#include "NpcompModule.h"
|
||||
#include "npcomp/Python/MlirIr.h"
|
||||
#include "npcomp/Python/NpcompModule.h"
|
||||
|
||||
#include "npcomp/Dialect/Basicpy/IR/BasicpyDialect.h"
|
||||
#include "npcomp/Dialect/Basicpy/IR/BasicpyOps.h"
|
|
@ -6,7 +6,7 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "PybindUtils.h"
|
||||
#include "npcomp/Python/PybindUtils.h"
|
||||
|
||||
namespace pybind11 {
|
||||
|
|
@ -25,15 +25,9 @@ set(NPCOMP_PYEXT_LIBADD ${PYTHON_LIBRARIES})
|
|||
# compiled separately for now.
|
||||
set(extension_target NPCOMPNativePyExt)
|
||||
set(extension_llvm_sources
|
||||
MlirInit.cpp
|
||||
)
|
||||
set(extension_pybind_sources
|
||||
MlirIr.cpp
|
||||
MlirPass.cpp
|
||||
NpcompDialect.cpp
|
||||
NpcompModule.cpp
|
||||
PybindUtils.cpp
|
||||
CoreDialects.cpp
|
||||
)
|
||||
set_source_files_properties(
|
||||
${extension_pybind_sources}
|
||||
|
@ -69,12 +63,8 @@ target_link_libraries(${extension_target}
|
|||
PRIVATE
|
||||
${dialect_libs}
|
||||
${conversion_libs}
|
||||
pybind11::module
|
||||
|
||||
NPCOMPInitAll
|
||||
|
||||
# Core dialects
|
||||
MLIRSCF
|
||||
NPCOMPPythonCommon
|
||||
|
||||
# Upstream depends
|
||||
LLVMSupport
|
||||
|
|
|
@ -9,9 +9,9 @@
|
|||
#include <cstddef>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "MlirInit.h"
|
||||
#include "NpcompModule.h"
|
||||
#include "PybindUtils.h"
|
||||
#include "npcomp/Python/MlirInit.h"
|
||||
#include "npcomp/Python/NpcompModule.h"
|
||||
#include "npcomp/Python/PybindUtils.h"
|
||||
|
||||
#include "llvm/Support/CommandLine.h"
|
||||
|
||||
|
|
Loading…
Reference in New Issue