Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
d1d0a75d
Commit
d1d0a75d
authored
Nov 08, 2018
by
Paul
Browse files
Add initial packaging and installation
parent
63978fb4
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
56 additions
and
20 deletions
+56
-20
CMakeLists.txt
CMakeLists.txt
+20
-0
src/CMakeLists.txt
src/CMakeLists.txt
+19
-6
src/onnx/CMakeLists.txt
src/onnx/CMakeLists.txt
+4
-0
src/targets/cpu/CMakeLists.txt
src/targets/cpu/CMakeLists.txt
+5
-4
src/targets/gpu/CMakeLists.txt
src/targets/gpu/CMakeLists.txt
+8
-10
No files found.
CMakeLists.txt
View file @
d1d0a75d
...
...
@@ -10,9 +10,20 @@ if( NOT MSVC_IDE AND NOT CMAKE_BUILD_TYPE )
set
(
CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
)
endif
()
# Default installation path
if
(
WIN32
)
set
(
CMAKE_INSTALL_PREFIX
"/opt/rocm/x86_64-w64-mingw32"
CACHE PATH
""
)
else
()
set
(
CMAKE_INSTALL_PREFIX
"/opt/rocm"
CACHE PATH
""
)
endif
()
project
(
migraphlib
)
find_package
(
ROCM REQUIRED
)
include
(
ROCMSetupVersion
)
rocm_setup_version
(
VERSION 0.1
)
option
(
BUILD_SHARED_LIBS
"Build as a shared library"
ON
)
if
(
CMAKE_CXX_COMPILER_ID STREQUAL
"GNU"
)
...
...
@@ -119,6 +130,15 @@ rocm_enable_cppcheck(
enable_testing
()
include
(
ROCMCreatePackage
)
rocm_create_package
(
NAME MIGraph
DESCRIPTION
"AMD's graph optimizer"
MAINTAINER
"Paul Fultz II <paul.fultz@amd.com>"
LDCONFIG
DEPENDS miopen-hip rocblas hip_hcc
)
add_subdirectory
(
src
)
add_subdirectory
(
doc
)
add_subdirectory
(
test
)
...
...
src/CMakeLists.txt
View file @
d1d0a75d
include
(
ROCMInstallTargets
)
include
(
ROCMPackageConfigHelpers
)
add_library
(
migraph
auto_contiguous.cpp
common_subexpression_elimination.cpp
...
...
@@ -19,20 +22,30 @@ add_library(migraph
opt/memory_coloring_impl.cpp
)
rocm_clang_tidy_check
(
migraph
)
target_include_directories
(
migraph PUBLIC $<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
/include>
)
rocm_install_targets
(
TARGETS migraph
INCLUDE
${
CMAKE_CURRENT_SOURCE_DIR
}
/include
)
find_path
(
HALF_INCLUDE_DIR half.hpp
)
target_include_directories
(
migraph SYSTEM PUBLIC
${
HALF_INCLUDE_DIR
}
)
# TODO: Fix the incorrect path
target_include_directories
(
migraph SYSTEM PUBLIC $<BUILD_INTERFACE:
${
HALF_INCLUDE_DIR
}
>
)
set
(
PACKAGE_DEPENDS
)
add_subdirectory
(
onnx
)
add_subdirectory
(
targets/cpu
)
if
(
MIGRAPH_ENABLE_GPU
)
list
(
APPEND PACKAGE_DEPENDS MIOpen rocblas
)
add_subdirectory
(
targets/gpu
)
endif
()
#install (TARGETS migraph
# LIBRARY DESTINATION /opt/rocm/lib)
#install (DIRECTORY include/migraph DESTINATION /opt/rocm/include)
rocm_export_targets
(
TARGETS migraph::migraph
NAMESPACE migraph::
DEPENDS
${
PACKAGE_DEPENDS
}
)
src/onnx/CMakeLists.txt
View file @
d1d0a75d
...
...
@@ -12,6 +12,10 @@ rocm_clang_tidy_check(migraph_onnx)
target_link_libraries
(
migraph_onnx PRIVATE onnx-proto
)
target_link_libraries
(
migraph_onnx PUBLIC migraph
)
rocm_install_targets
(
TARGETS migraph_onnx
)
add_executable
(
read_onnx read_onnx.cpp
)
rocm_clang_tidy_check
(
read_onnx
)
target_link_libraries
(
read_onnx migraph_onnx
)
...
...
src/targets/cpu/CMakeLists.txt
View file @
d1d0a75d
...
...
@@ -10,11 +10,12 @@ find_package(Threads)
rocm_clang_tidy_check
(
migraph_cpu
)
target_link_libraries
(
migraph_cpu migraph Threads::Threads
)
target_include_directories
(
migraph_cpu PUBLIC $<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
/include>
)
target_include_directories
(
migraph_cpu PRIVATE
${
BLAZE_INCLUDE
}
)
target_compile_definitions
(
migraph_cpu PRIVATE -DBLAZE_USE_CPP_THREADS
)
#install (TARGETS migraph_cpu
# LIBRARY DESTINATION /opt/rocm/lib)
#install (DIRECTORY include/migraph DESTINATION /opt/rocm/include)
rocm_install_targets
(
TARGETS migraph_cpu
INCLUDE
${
CMAKE_CURRENT_SOURCE_DIR
}
/include
)
src/targets/gpu/CMakeLists.txt
View file @
d1d0a75d
...
...
@@ -10,7 +10,7 @@ if(NOT TARGET MIOpen)
message
(
SEND_ERROR
"Cant find miopen"
)
endif
()
add_library
(
migraph_device
add_library
(
migraph_device
STATIC
device/add.cpp
device/add_relu.cpp
device/contiguous.cpp
...
...
@@ -43,14 +43,12 @@ add_library(migraph_gpu
rocblas.cpp
)
rocm_clang_tidy_check
(
migraph_gpu
)
target_link_libraries
(
migraph_gpu migraph MIOpen
migraph_device
roc::rocblas
)
target_in
clude_directo
ries
(
migraph_gpu P
UBLIC $<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
/include>
)
target_link_libraries
(
migraph_gpu
PUBLIC
migraph MIOpen roc::rocblas
)
target_
l
in
k_libra
ries
(
migraph_gpu P
RIVATE migraph_device
)
#install (TARGETS migraph_gpu
# LIBRARY DESTINATION /opt/rocm/lib)
#install (DIRECTORY include/migraph DESTINATION /opt/rocm/include)
#install (TARGETS migraph_device
# LIBRARY DESTINATION /opt/rocm/lib)
#install (DIRECTORY include/migraph DESTINATION /opt/rocm/include)
rocm_install_targets
(
TARGETS migraph_gpu
INCLUDE
${
CMAKE_CURRENT_SOURCE_DIR
}
/include
)
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