From 046a993967f067d9d77f13bad6e5dc4921fa9774 Mon Sep 17 00:00:00 2001 From: Nicolas Vasilache Date: Mon, 8 Apr 2019 06:47:06 -0700 Subject: [PATCH] Add CMakeLists rules for Linalg -- PiperOrigin-RevId: 242454319 --- mlir/examples/Linalg/CMakeLists.txt | 22 +++++ mlir/examples/Linalg/Linalg1/CMakeLists.txt | 52 +++++++++++ .../Linalg/Linalg1/lib/CMakeLists.txt | 28 ++++++ mlir/examples/Linalg/Linalg2/CMakeLists.txt | 31 +++++++ .../Linalg/Linalg2/lib/CMakeLists.txt | 14 +++ mlir/examples/Linalg/Linalg3/CMakeLists.txt | 90 +++++++++++++++++++ .../Linalg/Linalg3/lib/CMakeLists.txt | 20 +++++ mlir/examples/Linalg/Linalg4/CMakeLists.txt | 34 +++++++ .../Linalg/Linalg4/lib/CMakeLists.txt | 3 + 9 files changed, 294 insertions(+) create mode 100644 mlir/examples/Linalg/CMakeLists.txt create mode 100644 mlir/examples/Linalg/Linalg1/CMakeLists.txt create mode 100644 mlir/examples/Linalg/Linalg1/lib/CMakeLists.txt create mode 100644 mlir/examples/Linalg/Linalg2/CMakeLists.txt create mode 100644 mlir/examples/Linalg/Linalg2/lib/CMakeLists.txt create mode 100644 mlir/examples/Linalg/Linalg3/CMakeLists.txt create mode 100644 mlir/examples/Linalg/Linalg3/lib/CMakeLists.txt create mode 100644 mlir/examples/Linalg/Linalg4/CMakeLists.txt create mode 100644 mlir/examples/Linalg/Linalg4/lib/CMakeLists.txt diff --git a/mlir/examples/Linalg/CMakeLists.txt b/mlir/examples/Linalg/CMakeLists.txt new file mode 100644 index 000000000000..c4a261044080 --- /dev/null +++ b/mlir/examples/Linalg/CMakeLists.txt @@ -0,0 +1,22 @@ +include_directories(Linalg1/) +include_directories(Linalg1/include/) +include_directories(Linalg2/include/) +include_directories(Linalg3/include/) +include_directories(Linalg4/include/) + +add_custom_target(Linalg) +set_target_properties(Linalg PROPERTIES FOLDER Examples) +add_dependencies(Linalg + linalg-conversion-1 + linalg-conversion-3 + linalg-example-1 + linalg-example-2 + linalg-example-3 + linalg-example-4 + linalg-execution-3 + ) + +add_subdirectory(Linalg1) +add_subdirectory(Linalg2) +add_subdirectory(Linalg3) +add_subdirectory(Linalg4) diff --git a/mlir/examples/Linalg/Linalg1/CMakeLists.txt b/mlir/examples/Linalg/Linalg1/CMakeLists.txt new file mode 100644 index 000000000000..ea072765ee14 --- /dev/null +++ b/mlir/examples/Linalg/Linalg1/CMakeLists.txt @@ -0,0 +1,52 @@ +add_subdirectory(lib) + +set(LLVM_LINK_COMPONENTS + Core + Support + ) + +set(LLVM_OPTIONAL_SOURCES Conversion.cpp Example.cpp) + +add_llvm_example(linalg-conversion-1 + Conversion.cpp + ) + +add_llvm_example(linalg-example-1 + Example.cpp + ) + +target_link_libraries(linalg-example-1 + PRIVATE + MLIRAnalysis + MLIRDialect + MLIREDSC + MLIRIR + MLIRLLVMIR + MLIRParser + MLIRPass + MLIRTransforms + Linalg1 + Linalg1DialectConstruction + ) + +whole_archive_link(linalg-example-1 + MLIRStandardOps + ) + +target_link_libraries(linalg-conversion-1 + PRIVATE + MLIRAnalysis + MLIRDialect + MLIREDSC + MLIRIR + MLIRLLVMIR + MLIRParser + MLIRPass + MLIRTransforms + Linalg1 + Linalg1DialectConstruction + ) + +whole_archive_link(linalg-conversion-1 + MLIRStandardOps + ) diff --git a/mlir/examples/Linalg/Linalg1/lib/CMakeLists.txt b/mlir/examples/Linalg/Linalg1/lib/CMakeLists.txt new file mode 100644 index 000000000000..6b814b593d4d --- /dev/null +++ b/mlir/examples/Linalg/Linalg1/lib/CMakeLists.txt @@ -0,0 +1,28 @@ +set(LLVM_OPTIONAL_SOURCES + Analysis.cpp + ConvertToLLVMDialect.cpp + SliceOp.cpp + ViewOp.cpp + Common.cpp + Dialect.cpp + RangeOp.cpp + Utils.cpp + ViewType.cpp + DialectConstruction.cpp + ) + +add_llvm_library(Linalg1 + Analysis.cpp + ConvertToLLVMDialect.cpp + SliceOp.cpp + ViewOp.cpp + Common.cpp + Dialect.cpp + RangeOp.cpp + Utils.cpp + ViewType.cpp + ) + +add_llvm_library(Linalg1DialectConstruction + DialectConstruction.cpp + ) diff --git a/mlir/examples/Linalg/Linalg2/CMakeLists.txt b/mlir/examples/Linalg/Linalg2/CMakeLists.txt new file mode 100644 index 000000000000..d31f727df051 --- /dev/null +++ b/mlir/examples/Linalg/Linalg2/CMakeLists.txt @@ -0,0 +1,31 @@ +add_subdirectory(lib) + +set(LLVM_LINK_COMPONENTS + Core + Support + ) + +set(LLVM_OPTIONAL_SOURCES Example.cpp) + +add_llvm_example(linalg-example-2 + Example.cpp + ) + +target_link_libraries(linalg-example-2 + PRIVATE + MLIRAnalysis + MLIRDialect + MLIREDSC + MLIRIR + MLIRLLVMIR + MLIRParser + MLIRPass + MLIRTransforms + Linalg1 + Linalg2 + Linalg2DialectConstruction + ) + +whole_archive_link(linalg-example-2 + MLIRStandardOps + ) diff --git a/mlir/examples/Linalg/Linalg2/lib/CMakeLists.txt b/mlir/examples/Linalg/Linalg2/lib/CMakeLists.txt new file mode 100644 index 000000000000..a8976ef35177 --- /dev/null +++ b/mlir/examples/Linalg/Linalg2/lib/CMakeLists.txt @@ -0,0 +1,14 @@ +set(LLVM_OPTIONAL_SOURCES + DialectConstruction.cpp + TensorOps.cpp + Transforms.cpp + ) + +add_llvm_library(Linalg2 + TensorOps.cpp + Transforms.cpp + ) + +add_llvm_library(Linalg2DialectConstruction + DialectConstruction.cpp + ) diff --git a/mlir/examples/Linalg/Linalg3/CMakeLists.txt b/mlir/examples/Linalg/Linalg3/CMakeLists.txt new file mode 100644 index 000000000000..8b1b3e9a4611 --- /dev/null +++ b/mlir/examples/Linalg/Linalg3/CMakeLists.txt @@ -0,0 +1,90 @@ +add_subdirectory(lib) + +set(LLVM_LINK_COMPONENTS + Core + OrcJIT + Support + native + ) + +set(LLVM_OPTIONAL_SOURCES + Conversion.cpp + Example.cpp + Execution.cpp + ) + +add_llvm_example(linalg-conversion-3 + Conversion.cpp + ) + +add_llvm_example(linalg-example-3 + Example.cpp + ) + +add_llvm_example(linalg-execution-3 + Execution.cpp + ) + +target_link_libraries(linalg-example-3 + PRIVATE + MLIRAnalysis + MLIRDialect + MLIREDSC + MLIRIR + MLIRLLVMIR + MLIRParser + MLIRPass + MLIRTransforms + Linalg1 + Linalg2 + Linalg3 + Linalg3DialectConstruction + ) + +whole_archive_link(linalg-example-3 + MLIRStandardOps + ) + +target_link_libraries(linalg-conversion-3 + PRIVATE + MLIRAnalysis + MLIRDialect + MLIREDSC + MLIRIR + MLIRLLVMIR + MLIRParser + MLIRPass + MLIRTransforms + Linalg1 + Linalg2 + Linalg3 + Linalg3DialectConstruction + ) + +whole_archive_link(linalg-conversion-3 + MLIRStandardOps + ) + +target_link_libraries(linalg-execution-3 + PRIVATE + MLIRAnalysis + MLIRDialect + MLIREDSC + MLIRExecutionEngine + MLIRIR + MLIRLLVMIR + MLIRParser + MLIRPass + MLIRSupport + MLIRTargetLLVMIR + MLIRTransforms + Linalg1 + Linalg2 + Linalg3 + Linalg3DialectConstruction + ) + +whole_archive_link(linalg-execution-3 + MLIRStandardOps + ) + diff --git a/mlir/examples/Linalg/Linalg3/lib/CMakeLists.txt b/mlir/examples/Linalg/Linalg3/lib/CMakeLists.txt new file mode 100644 index 000000000000..4055b7a32da4 --- /dev/null +++ b/mlir/examples/Linalg/Linalg3/lib/CMakeLists.txt @@ -0,0 +1,20 @@ +set(LLVM_OPTIONAL_SOURCES + Analysis.cpp + ConvertToLLVMDialect.cpp + LoadStoreOps.cpp + Transforms.cpp + DialectConstruction.cpp + TensorOps.cpp + ) + +add_llvm_library(Linalg3 + Analysis.cpp + ConvertToLLVMDialect.cpp + LoadStoreOps.cpp + Transforms.cpp + TensorOps.cpp + ) + +add_llvm_library(Linalg3DialectConstruction + DialectConstruction.cpp + ) diff --git a/mlir/examples/Linalg/Linalg4/CMakeLists.txt b/mlir/examples/Linalg/Linalg4/CMakeLists.txt new file mode 100644 index 000000000000..61bc28729c10 --- /dev/null +++ b/mlir/examples/Linalg/Linalg4/CMakeLists.txt @@ -0,0 +1,34 @@ +add_subdirectory(lib) + +set(LLVM_LINK_COMPONENTS + Core + Support + ) + +set(LLVM_OPTIONAL_SOURCES Example.cpp) + +add_llvm_example(linalg-example-4 + Example.cpp + ) + +target_link_libraries(linalg-example-4 + PRIVATE + MLIRAnalysis + MLIRDialect + MLIREDSC + MLIRIR + MLIRLLVMIR + MLIRParser + MLIRPass + MLIRTransforms + Linalg1 + Linalg2 + Linalg3 + Linalg4 + Linalg3DialectConstruction + ) + +whole_archive_link(linalg-example-4 + MLIRStandardOps + ) + diff --git a/mlir/examples/Linalg/Linalg4/lib/CMakeLists.txt b/mlir/examples/Linalg/Linalg4/lib/CMakeLists.txt new file mode 100644 index 000000000000..dac8b350a4dc --- /dev/null +++ b/mlir/examples/Linalg/Linalg4/lib/CMakeLists.txt @@ -0,0 +1,3 @@ +add_llvm_library(Linalg4 + Transforms.cpp + )