flatten src directory structure
This commit is contained in:
parent
922a40962c
commit
da4527c961
|
@ -24,9 +24,6 @@ add_subdirectory(third_party/benchmark)
|
|||
add_subdirectory(third_party/pybind11)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
add_subdirectory(src/builder)
|
||||
add_subdirectory(src/compiler)
|
||||
add_subdirectory(src/runtime)
|
||||
add_subdirectory(src)
|
||||
|
||||
add_subdirectory(test)
|
||||
|
|
|
@ -1,3 +1,73 @@
|
|||
add_library(compiler
|
||||
dialect/krnl/krnl_ops.cpp
|
||||
dialect/krnl/krnl_ops.hpp
|
||||
dialect/krnl/krnl_types.cpp
|
||||
dialect/krnl/krnl_types.hpp
|
||||
dialect/onnx/onnx_ops.cpp
|
||||
dialect/onnx/onnx_ops.hpp
|
||||
dialect/krnl/krnl_helper.cpp
|
||||
dialect/krnl/krnl_helper.hpp
|
||||
pass/shape_inference_pass.cpp
|
||||
pass/shape_inference_interface.hpp
|
||||
dialect/onnx/onnxop.inc
|
||||
pass/onnx_combine.cpp
|
||||
pass/lower_frontend_to_krnl.cpp
|
||||
pass/passes.hpp)
|
||||
|
||||
# Include root src directory.
|
||||
target_include_directories(compiler PRIVATE ${ONNF_SRC_ROOT})
|
||||
|
||||
# Include tablegen generated header files.
|
||||
target_include_directories(compiler PRIVATE ${ONNF_BIN_ROOT})
|
||||
|
||||
target_link_libraries(compiler
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
${CMAKE_DL_LIBS}
|
||||
${MLIRLibs}
|
||||
curses)
|
||||
|
||||
set(LLVM_TARGET_DEFINITIONS pass/shape_inference_interface.td)
|
||||
onnf_tablegen(shape_inference.hpp.inc -gen-op-interface-decls)
|
||||
onnf_tablegen(shape_inference.cpp.inc -gen-op-interface-defs)
|
||||
add_public_tablegen_target(gen_shape_inference)
|
||||
add_dependencies(compiler gen_shape_inference)
|
||||
|
||||
set(LLVM_TARGET_DEFINITIONS pass/onnx_combine.td)
|
||||
onnf_tablegen(onnx_combine.inc -gen-rewriters)
|
||||
add_public_tablegen_target(gen_onnx_combine)
|
||||
add_dependencies(compiler gen_onnx_combine)
|
||||
|
||||
set(LLVM_TARGET_DEFINITIONS dialect/onnx/onnx.td)
|
||||
onnf_tablegen(onnx.hpp.inc -gen-op-decls "-I${CMAKE_SOURCE_DIR}/compiler/pass")
|
||||
onnf_tablegen(onnx.cpp.inc -gen-op-defs "-I${CMAKE_SOURCE_DIR}/compiler/pass")
|
||||
add_public_tablegen_target(gen_onnx)
|
||||
add_dependencies(compiler gen_onnx)
|
||||
|
||||
set(LLVM_TARGET_DEFINITIONS dialect/krnl/krnl_ops.td)
|
||||
onnf_tablegen(krnl.hpp.inc -gen-op-decls)
|
||||
onnf_tablegen(krnl.cpp.inc -gen-op-defs)
|
||||
add_public_tablegen_target(gen_krnl_ops)
|
||||
add_dependencies(compiler gen_krnl_ops)
|
||||
|
||||
add_library(onnf_shape_inference pass/shape_inference_pass.cpp)
|
||||
target_include_directories(onnf_shape_inference
|
||||
PRIVATE ${ONNF_SRC_ROOT} ${ONNF_BIN_ROOT}
|
||||
${ONNF_SRC_ROOT})
|
||||
target_link_libraries(onnf_shape_inference ${MLIRLibs})
|
||||
add_dependencies(onnf_shape_inference gen_krnl_ops)
|
||||
|
||||
add_library(onnf_lower_frontend pass/lower_frontend_to_krnl.cpp)
|
||||
target_include_directories(onnf_lower_frontend
|
||||
PRIVATE ${ONNF_SRC_ROOT} ${ONNF_BIN_ROOT}
|
||||
${ONNF_SRC_ROOT})
|
||||
target_link_libraries(onnf_lower_frontend ${MLIRLibs})
|
||||
add_dependencies(onnf_lower_frontend gen_krnl_ops)
|
||||
|
||||
add_subdirectory(transform)
|
||||
add_subdirectory(tool)
|
||||
add_subdirectory(builder)
|
||||
add_subdirectory(runtime)
|
||||
|
||||
add_executable(onnf main.cpp)
|
||||
|
||||
target_link_libraries(onnf builder compiler ${MLIRLibs} onnf_transform)
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#include "llvm/ADT/ScopedHashTable.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
|
||||
#include "src/compiler/dialect/onnx/onnx_ops.hpp"
|
||||
#include "src/dialect/onnx/onnx_ops.hpp"
|
||||
|
||||
#include "frontend_dialect_transformer.hpp"
|
||||
|
||||
|
|
|
@ -1,75 +0,0 @@
|
|||
add_library(
|
||||
compiler
|
||||
dialect/krnl/krnl_ops.cpp
|
||||
dialect/krnl/krnl_ops.hpp
|
||||
dialect/krnl/krnl_types.cpp
|
||||
dialect/krnl/krnl_types.hpp
|
||||
dialect/onnx/onnx_ops.cpp
|
||||
dialect/onnx/onnx_ops.hpp
|
||||
dialect/krnl/krnl_helper.cpp
|
||||
dialect/krnl/krnl_helper.hpp
|
||||
pass/shape_inference_pass.cpp
|
||||
pass/shape_inference_interface.hpp
|
||||
dialect/onnx/onnxop.inc
|
||||
pass/onnx_combine.cpp
|
||||
pass/lower_frontend_to_krnl.cpp
|
||||
pass/passes.hpp)
|
||||
|
||||
# Include root src directory.
|
||||
target_include_directories(compiler PRIVATE ${ONNF_SRC_ROOT})
|
||||
|
||||
# Include third-party libraries.
|
||||
target_include_directories(compiler PRIVATE ${ONNF_SRC_ROOT}/third_party/isl/include)
|
||||
target_include_directories(compiler PRIVATE ${ONNF_BIN_ROOT}/third_party/isl/include)
|
||||
target_include_directories(compiler PRIVATE ${ONNF_SRC_ROOT}/third_party/Linq)
|
||||
target_include_directories(compiler PRIVATE ${ONNF_SRC_ROOT}/third_party/inja/src)
|
||||
target_include_directories(compiler PRIVATE ${ONNF_SRC_ROOT}/third_party/fmt/include)
|
||||
|
||||
# Include tablegen generated header files.
|
||||
target_include_directories(compiler PRIVATE ${ONNF_BIN_ROOT})
|
||||
|
||||
target_link_libraries(compiler
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
${CMAKE_DL_LIBS}
|
||||
${MLIRLibs}
|
||||
curses)
|
||||
|
||||
set(LLVM_TARGET_DEFINITIONS pass/shape_inference_interface.td)
|
||||
onnf_tablegen(shape_inference.hpp.inc -gen-op-interface-decls)
|
||||
onnf_tablegen(shape_inference.cpp.inc -gen-op-interface-defs)
|
||||
add_public_tablegen_target(gen_shape_inference)
|
||||
add_dependencies(compiler gen_shape_inference)
|
||||
|
||||
set(LLVM_TARGET_DEFINITIONS pass/onnx_combine.td)
|
||||
onnf_tablegen(onnx_combine.inc -gen-rewriters)
|
||||
add_public_tablegen_target(gen_onnx_combine)
|
||||
add_dependencies(compiler gen_onnx_combine)
|
||||
|
||||
set(LLVM_TARGET_DEFINITIONS dialect/onnx/onnx.td)
|
||||
onnf_tablegen(onnx.hpp.inc -gen-op-decls "-I${CMAKE_SOURCE_DIR}/compiler/pass")
|
||||
onnf_tablegen(onnx.cpp.inc -gen-op-defs "-I${CMAKE_SOURCE_DIR}/compiler/pass")
|
||||
add_public_tablegen_target(gen_onnx)
|
||||
add_dependencies(compiler gen_onnx)
|
||||
|
||||
set(LLVM_TARGET_DEFINITIONS dialect/krnl/krnl_ops.td)
|
||||
onnf_tablegen(krnl.hpp.inc -gen-op-decls)
|
||||
onnf_tablegen(krnl.cpp.inc -gen-op-defs)
|
||||
add_public_tablegen_target(gen_krnl_ops)
|
||||
add_dependencies(compiler gen_krnl_ops)
|
||||
|
||||
add_library(onnf_shape_inference pass/shape_inference_pass.cpp)
|
||||
target_include_directories(onnf_shape_inference
|
||||
PRIVATE ${ONNF_SRC_ROOT} ${ONNF_BIN_ROOT}
|
||||
${ONNF_SRC_ROOT})
|
||||
target_link_libraries(onnf_shape_inference ${MLIRLibs})
|
||||
add_dependencies(onnf_shape_inference gen_krnl_ops)
|
||||
|
||||
add_library(onnf_lower_frontend pass/lower_frontend_to_krnl.cpp)
|
||||
target_include_directories(onnf_lower_frontend
|
||||
PRIVATE ${ONNF_SRC_ROOT} ${ONNF_BIN_ROOT}
|
||||
${ONNF_SRC_ROOT})
|
||||
target_link_libraries(onnf_lower_frontend ${MLIRLibs})
|
||||
add_dependencies(onnf_lower_frontend gen_krnl_ops)
|
||||
|
||||
add_subdirectory(transform)
|
||||
add_subdirectory(tool)
|
|
@ -1,5 +0,0 @@
|
|||
add_library(DLCAnalysis STATIC
|
||||
extract_integer_set.cpp)
|
||||
|
||||
target_include_directories(DLCAnalysis PRIVATE ${DLC_SRC_ROOT})
|
||||
target_include_directories(DLCAnalysis PRIVATE ${DLC_BIN_ROOT})
|
|
@ -1,7 +1,7 @@
|
|||
#include "mlir/Dialect/AffineOps/AffineOps.h"
|
||||
#include "mlir/IR/AffineExpr.h"
|
||||
|
||||
#include "src/compiler/dialect/krnl/krnl_ops.hpp"
|
||||
#include "krnl_ops.hpp"
|
||||
|
||||
#include "krnl_helper.hpp"
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
#include "llvm/ADT/SetVector.h"
|
||||
#include "llvm/ADT/SmallBitVector.h"
|
||||
|
||||
#include "src/compiler/dialect/krnl/krnl_helper.hpp"
|
||||
#include "krnl_helper.hpp"
|
||||
|
||||
#include "krnl_ops.hpp"
|
||||
|
||||
|
@ -35,7 +35,7 @@ KrnlOpsDialect::KrnlOpsDialect(MLIRContext *context)
|
|||
: Dialect(getDialectNamespace(), context) {
|
||||
addOperations<
|
||||
#define GET_OP_LIST
|
||||
#include "src/compiler/krnl.cpp.inc"
|
||||
#include "src/krnl.cpp.inc"
|
||||
>();
|
||||
addTypes<LoopType>();
|
||||
}
|
||||
|
@ -373,5 +373,5 @@ void KrnlEntryPointOp::build(mlir::Builder *builder, OperationState &state,
|
|||
}
|
||||
|
||||
#define GET_OP_CLASSES
|
||||
#include "src/compiler/krnl.cpp.inc"
|
||||
#include "src/krnl.cpp.inc"
|
||||
} // namespace mlir
|
|
@ -15,8 +15,8 @@
|
|||
#include "mlir/IR/OpDefinition.h"
|
||||
#include "mlir/IR/StandardTypes.h"
|
||||
|
||||
#include "src/compiler/dialect/krnl/krnl_helper.hpp"
|
||||
#include "src/compiler/dialect/krnl/krnl_types.hpp"
|
||||
#include "krnl_helper.hpp"
|
||||
#include "krnl_types.hpp"
|
||||
|
||||
namespace mlir {
|
||||
class KrnlOpsDialect : public Dialect {
|
||||
|
@ -43,5 +43,5 @@ public:
|
|||
};
|
||||
|
||||
#define GET_OP_CLASSES
|
||||
#include "src/compiler/krnl.hpp.inc"
|
||||
#include "src/krnl.hpp.inc"
|
||||
} // namespace mlir
|
|
@ -33,7 +33,7 @@ ONNXOpsDialect::ONNXOpsDialect(mlir::MLIRContext *ctx)
|
|||
: mlir::Dialect(getDialectNamespace(), ctx) {
|
||||
addOperations<
|
||||
#define GET_OP_LIST
|
||||
#include "src/compiler/onnx.cpp.inc"
|
||||
#include "src/onnx.cpp.inc"
|
||||
>();
|
||||
}
|
||||
|
||||
|
@ -389,4 +389,4 @@ void ONNXReshapeOp::inferShapes() {
|
|||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#define GET_OP_CLASSES
|
||||
#include "src/compiler/onnx.cpp.inc"
|
||||
#include "src/onnx.cpp.inc"
|
|
@ -16,7 +16,7 @@
|
|||
#include "mlir/IR/OpDefinition.h"
|
||||
#include "mlir/IR/StandardTypes.h"
|
||||
|
||||
#include "src/compiler/pass/shape_inference_interface.hpp"
|
||||
#include "src/pass/shape_inference_interface.hpp"
|
||||
|
||||
namespace mlir {
|
||||
|
||||
|
@ -32,7 +32,7 @@ class ONNXOpsDialect : public Dialect {
|
|||
/// Include the auto-generated header file containing the declarations of the
|
||||
/// ONNX operations.
|
||||
#define GET_OP_CLASSES
|
||||
#include "src/compiler/onnx.hpp.inc"
|
||||
#include "src/onnx.hpp.inc"
|
||||
|
||||
} // end namespace mlir
|
||||
|
|
@ -17,9 +17,9 @@
|
|||
#include "llvm/Support/SourceMgr.h"
|
||||
|
||||
#include "src/builder/frontend_dialect_transformer.hpp"
|
||||
#include "src/compiler/dialect/krnl/krnl_ops.hpp"
|
||||
#include "src/compiler/dialect/onnx/onnx_ops.hpp"
|
||||
#include "src/compiler/pass/passes.hpp"
|
||||
#include "src/dialect/krnl/krnl_ops.hpp"
|
||||
#include "src/dialect/onnx/onnx_ops.hpp"
|
||||
#include "src/pass/passes.hpp"
|
||||
|
||||
#include "mlir/Conversion/LoopToStandard/ConvertLoopToStandard.h"
|
||||
#include "mlir/ExecutionEngine/ExecutionEngine.h"
|
||||
|
|
|
@ -17,10 +17,10 @@
|
|||
#include "llvm/ADT/ArrayRef.h"
|
||||
#include "llvm/ADT/Sequence.h"
|
||||
|
||||
#include "src/compiler/dialect/krnl/krnl_helper.hpp"
|
||||
#include "src/compiler/dialect/krnl/krnl_ops.hpp"
|
||||
#include "src/compiler/dialect/onnx/onnx_ops.hpp"
|
||||
#include "src/compiler/pass/passes.hpp"
|
||||
#include "src/dialect/krnl/krnl_helper.hpp"
|
||||
#include "src/dialect/krnl/krnl_ops.hpp"
|
||||
#include "src/dialect/onnx/onnx_ops.hpp"
|
||||
#include "passes.hpp"
|
||||
|
||||
using namespace mlir;
|
||||
|
|
@ -13,13 +13,13 @@
|
|||
#include "mlir/IR/PatternMatch.h"
|
||||
|
||||
#include <numeric>
|
||||
#include "src/compiler/dialect/onnx/onnx_ops.hpp"
|
||||
#include "src/dialect/onnx/onnx_ops.hpp"
|
||||
|
||||
using namespace mlir;
|
||||
|
||||
namespace {
|
||||
/// Include the patterns defined in the Declarative Rewrite framework.
|
||||
#include "src/compiler/onnx_combine.inc"
|
||||
#include "src/onnx_combine.inc"
|
||||
} // end anonymous namespace
|
||||
|
||||
/// Register optimization patterns as "canonicalization" patterns
|
|
@ -16,6 +16,6 @@
|
|||
namespace mlir {
|
||||
|
||||
/// Include the auto-generated declarations.
|
||||
#include "src/compiler/shape_inference.hpp.inc"
|
||||
#include "src/shape_inference.hpp.inc"
|
||||
|
||||
} // end namespace mlir
|
|
@ -14,14 +14,14 @@
|
|||
#include "llvm/Support/raw_ostream.h"
|
||||
|
||||
#include "shape_inference_interface.hpp"
|
||||
#include "src/compiler/dialect/onnx/onnx_ops.hpp"
|
||||
#include "src/dialect/onnx/onnx_ops.hpp"
|
||||
|
||||
#include "passes.hpp"
|
||||
|
||||
using namespace mlir;
|
||||
|
||||
// Include the auto-generated definitions for the shape inference interfaces.
|
||||
#include "src/compiler/shape_inference.cpp.inc"
|
||||
#include "src/shape_inference.cpp.inc"
|
||||
|
||||
namespace {
|
||||
/*!
|
|
@ -3,8 +3,8 @@ add_library(cruntime
|
|||
dyn_memref.h
|
||||
data_type.h)
|
||||
target_include_directories(cruntime
|
||||
PRIVATE ${DLC_SRC_ROOT} ${DLC_BIN_ROOT}
|
||||
${DLC_SRC_ROOT})
|
||||
PRIVATE ${ONNF_SRC_ROOT} ${ONNF_BIN_ROOT}
|
||||
${ONNF_SRC_ROOT})
|
||||
|
||||
pybind11_add_module(pyruntime
|
||||
dyn_memref.cpp
|
||||
|
|
|
@ -14,9 +14,9 @@
|
|||
#include <mlir/Support/FileUtilities.h>
|
||||
#include <mlir/Support/MlirOptMain.h>
|
||||
|
||||
#include "src/compiler/dialect/krnl/krnl_ops.hpp"
|
||||
#include "src/compiler/dialect/onnx/onnx_ops.hpp"
|
||||
#include "src/compiler/pass/passes.hpp"
|
||||
#include "src/dialect/krnl/krnl_ops.hpp"
|
||||
#include "src/dialect/onnx/onnx_ops.hpp"
|
||||
#include "src/pass/passes.hpp"
|
||||
|
||||
using namespace onnf;
|
||||
|
|
@ -3,8 +3,8 @@
|
|||
#include "mlir/Pass/Pass.h"
|
||||
#include "mlir/Transforms/DialectConversion.h"
|
||||
|
||||
#include "src/compiler/dialect/krnl/krnl_ops.hpp"
|
||||
#include "src/compiler/pass/passes.hpp"
|
||||
#include "src/dialect/krnl/krnl_ops.hpp"
|
||||
#include "src/pass/passes.hpp"
|
||||
|
||||
using namespace mlir;
|
||||
|
|
@ -16,8 +16,8 @@
|
|||
#include "mlir/Transforms/DialectConversion.h"
|
||||
#include "llvm/ADT/Sequence.h"
|
||||
|
||||
#include "src/compiler/dialect/krnl/krnl_ops.hpp"
|
||||
#include "src/compiler/pass/passes.hpp"
|
||||
#include "src/dialect/krnl/krnl_ops.hpp"
|
||||
#include "src/pass/passes.hpp"
|
||||
|
||||
using namespace mlir;
|
||||
|
Loading…
Reference in New Issue