Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
ngraph
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ngraph
Commits
321f32f5
Unverified
Commit
321f32f5
authored
Sep 04, 2019
by
Scott Cyphers
Committed by
GitHub
Sep 04, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into cyphers/typename
parents
d41a8b19
f6425cbd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
24 deletions
+25
-24
external_mlir.cmake
cmake/external_mlir.cmake
+16
-3
CMakeLists.txt
src/contrib/mlir/CMakeLists.txt
+8
-0
CMakeLists.txt
src/contrib/mlir/compiler/CMakeLists.txt
+0
-18
CMakeLists.txt
src/ngraph/runtime/cpu/CMakeLists.txt
+1
-3
No files found.
cmake/external_mlir.cmake
View file @
321f32f5
...
...
@@ -47,10 +47,23 @@ execute_process(COMMAND "${CMAKE_COMMAND}" --build . --target ext_mlir_llvm
execute_process
(
COMMAND
"
${
CMAKE_COMMAND
}
"
--build . --target ext_mlir
WORKING_DIRECTORY
"
${
MLIR_PROJECT_ROOT
}
"
)
# point find_package to the pre-built libs
set
(
LLVM_DIR
${
MLIR_LLVM_ROOT
}
/build/lib/cmake/llvm
)
# Enable modules for LLVM.
set
(
LLVM_DIR
"
${
MLIR_BUILD_DIR
}
/lib/cmake/llvm"
CACHE PATH
"Path to LLVM cmake modules"
)
list
(
APPEND CMAKE_MODULE_PATH
"
${
LLVM_DIR
}
"
)
include
(
AddLLVM
)
# Enable LLVM package, definitions and env vars.
find_package
(
LLVM REQUIRED CONFIG
)
add_definitions
(
${
LLVM_DEFINITIONS
}
)
message
(
STATUS
"Found LLVM
${
LLVM_PACKAGE_VERSION
}
"
)
message
(
STATUS
"Using modules in:
${
LLVM_DIR
}
"
)
message
(
STATUS
"LLVM RTTI is
${
LLVM_ENABLE_RTTI
}
"
)
set
(
MLIR_SRC_INCLUDE_PATH
${
MLIR_SOURCE_DIR
}
/include
)
set
(
MLIR_BIN_INCLUDE_PATH
${
MLIR_BUILD_DIR
}
/projects/mlir/include
)
set
(
MLIR_INCLUDE_PATHS
${
MLIR_SRC_INCLUDE_PATH
}
;
${
MLIR_BIN_INCLUDE_PATH
}
)
set
(
MLIR_INCLUDE_PATHS
${
MLIR_SRC_INCLUDE_PATH
}
;
${
MLIR_BIN_INCLUDE_PATH
}
)
set
(
MLIR_LLVM_INCLUDE_PATH
${
LLVM_INCLUDE_DIRS
}
)
message
(
STATUS
"MLIR headers at:
${
MLIR_INCLUDE_PATHS
}
"
)
message
(
STATUS
"LLVM headers at:
${
MLIR_LLVM_INCLUDE_PATH
}
"
)
src/contrib/mlir/CMakeLists.txt
View file @
321f32f5
...
...
@@ -14,4 +14,12 @@
# limitations under the License.
# ******************************************************************************
# Common MLIR/LLVM setup for the sub-directories below
include_directories
(
${
NGRAPH_INCLUDE_PATH
}
${
MLIR_LLVM_INCLUDE_PATH
}
${
MLIR_INCLUDE_PATHS
}
)
add_subdirectory
(
compiler
)
src/contrib/mlir/compiler/CMakeLists.txt
View file @
321f32f5
...
...
@@ -27,24 +27,6 @@ set(SRC
add_library
(
mlir_backend SHARED
${
SRC
}
)
message
(
STATUS
"LLVM Directory:
${
LLVM_DIR
}
"
)
# Link LLVM and MLIR
find_package
(
LLVM REQUIRED CONFIG
)
set
(
MLIR_LLVM_INCLUDEPATH
${
LLVM_INCLUDE_DIRS
}
)
message
(
STATUS
"Found LLVM
${
LLVM_PACKAGE_VERSION
}
"
)
message
(
STATUS
"Using LLVMConfig.cmake in:
${
LLVM_DIR
}
"
)
message
(
STATUS
"LLVM RTTI is
${
LLVM_ENABLE_RTTI
}
"
)
add_definitions
(
${
LLVM_DEFINITIONS
}
)
target_include_directories
(
mlir_backend PRIVATE
${
LLVM_INCLUDE_DIRS
}
)
message
(
STATUS
"MLIR Headers at :
${
MLIR_INCLUDE_PATHS
}
"
)
message
(
STATUS
"LLVM Headers at :
${
MLIR_LLVM_INCLUDEPATH
}
"
)
target_include_directories
(
mlir_backend PRIVATE
${
MLIR_INCLUDE_PATHS
}
)
llvm_map_components_to_libnames
(
llvm_libs support core irreader
)
# Link MLIR libs
...
...
src/ngraph/runtime/cpu/CMakeLists.txt
View file @
321f32f5
...
...
@@ -233,10 +233,8 @@ if (NGRAPH_CPU_ENABLE)
DEFINITION MLIR_LLVM_INCLUDEPATH
)
message
(
STATUS
"Building CPU backend with MLIR"
)
message
(
STATUS
"MLIR INCLUDE DIRS:
${
MLIR_INCLUDE_PATHS
}
"
)
message
(
STATUS
"LLVM INCLUDE DIRS:
${
MLIR_LLVM_INCLUDEPATH
}
"
)
add_dependencies
(
cpu_backend mlir_backend
)
target_include_directories
(
cpu_backend PUBLIC
${
MLIR_INCLUDE_PATHS
}
${
MLIR_LLVM_INCLUDEPATH
}
)
target_include_directories
(
cpu_backend PUBLIC
${
MLIR_INCLUDE_PATHS
}
${
MLIR_LLVM_INCLUDE
_
PATH
}
)
target_link_libraries
(
cpu_backend PUBLIC mlir_backend
)
# TODO: Get rid of the compile time def, and move all MLIR code to separate src files
# and add them to cpu_backend here instead.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment