Add CMakeLists rules for Linalg

--

PiperOrigin-RevId: 242454319
This commit is contained in:
Nicolas Vasilache 2019-04-08 06:47:06 -07:00 committed by Mehdi Amini
parent af016ba7a4
commit 046a993967
9 changed files with 294 additions and 0 deletions

View File

@ -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)

View File

@ -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
)

View File

@ -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
)

View File

@ -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
)

View File

@ -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
)

View File

@ -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
)

View File

@ -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
)

View File

@ -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
)

View File

@ -0,0 +1,3 @@
add_llvm_library(Linalg4
Transforms.cpp
)