-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
… automatic_sparsity_functions
- Loading branch information
Showing
395 changed files
with
12,569 additions
and
4,893 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
INCLUDE(ExternalProject) | ||
|
||
SET(ROCKSDB_SOURCES_DIR ${THIRD_PARTY_PATH}/rocksdb) | ||
SET(ROCKSDB_INSTALL_DIR ${THIRD_PARTY_PATH}/install/rocksdb) | ||
SET(ROCKSDB_INCLUDE_DIR "${ROCKSDB_INSTALL_DIR}/include" CACHE PATH "rocksdb include directory." FORCE) | ||
SET(ROCKSDB_LIBRARIES "${ROCKSDB_INSTALL_DIR}/lib/librocksdb.a" CACHE FILEPATH "rocksdb library." FORCE) | ||
SET(ROCKSDB_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") | ||
INCLUDE_DIRECTORIES(${ROCKSDB_INCLUDE_DIR}) | ||
|
||
ExternalProject_Add( | ||
extern_rocksdb | ||
${EXTERNAL_PROJECT_LOG_ARGS} | ||
PREFIX ${ROCKSDB_SOURCES_DIR} | ||
GIT_REPOSITORY "https://github.com/facebook/rocksdb" | ||
GIT_TAG v6.10.1 | ||
UPDATE_COMMAND "" | ||
CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} | ||
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} | ||
-DWITH_BZ2=OFF | ||
-DWITH_GFLAGS=OFF | ||
-DCMAKE_CXX_FLAGS=${ROCKSDB_CMAKE_CXX_FLAGS} | ||
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} | ||
# BUILD_BYPRODUCTS ${ROCKSDB_SOURCES_DIR}/src/extern_rocksdb/librocksdb.a | ||
INSTALL_COMMAND mkdir -p ${ROCKSDB_INSTALL_DIR}/lib/ | ||
&& cp ${ROCKSDB_SOURCES_DIR}/src/extern_rocksdb/librocksdb.a ${ROCKSDB_LIBRARIES} | ||
&& cp -r ${ROCKSDB_SOURCES_DIR}/src/extern_rocksdb/include ${ROCKSDB_INSTALL_DIR}/ | ||
BUILD_IN_SOURCE 1 | ||
) | ||
|
||
ADD_DEPENDENCIES(extern_rocksdb snappy) | ||
|
||
ADD_LIBRARY(rocksdb STATIC IMPORTED GLOBAL) | ||
SET_PROPERTY(TARGET rocksdb PROPERTY IMPORTED_LOCATION ${ROCKSDB_LIBRARIES}) | ||
ADD_DEPENDENCIES(rocksdb extern_rocksdb) | ||
|
||
LIST(APPEND external_project_dependencies rocksdb) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
if(NOT WITH_ROCM) | ||
return() | ||
endif() | ||
|
||
# Now we don't support ROCm on windows | ||
if(WIN32) | ||
return() | ||
endif() | ||
|
||
set(MIOPEN_ROOT ${ROCM_PATH}/miopen CACHE PATH "MIOPEN ROOT") | ||
|
||
find_path(MIOPEN_INCLUDE_DIR "miopen/miopen.h" | ||
PATHS ${MIOPEN_ROOT} ${MIOPEN_ROOT}/include ${MIOPEN_ROOT}/local/include | ||
$ENV{MIOPEN_ROOT} $ENV{MIOPEN_ROOT}/include $ENV{MIOPEN_ROOT}/local/include | ||
NO_DEFAULT_PATH | ||
) | ||
|
||
get_filename_component(__libpath_hist ${CUDA_CUDART_LIBRARY} PATH) | ||
|
||
find_library(MIOPEN_LIBRARY NAMES "libMIOpen.so" | ||
PATHS ${MIOPEN_ROOT} ${MIOPEN_ROOT}/lib ${MIOPEN_ROOT}/lib64 ${__libpath_hist} | ||
$ENV{MIOPEN_ROOT} $ENV{MIOPEN_ROOT}/lib $ENV{MIOPEN_ROOT}/lib64 | ||
NO_DEFAULT_PATH | ||
DOC "Path to MIOpen library.") | ||
|
||
if(MIOPEN_INCLUDE_DIR AND MIOPEN_LIBRARY) | ||
set(MIOPEN_FOUND ON) | ||
else() | ||
set(MIOPEN_FOUND OFF) | ||
endif() | ||
|
||
macro(find_miopen_version miopen_header_file) | ||
file(READ ${miopen_header_file} MIOPEN_VERSION_FILE_CONTENTS) | ||
get_filename_component(MIOPEN_LIB_PATH ${MIOPEN_LIBRARY} DIRECTORY) | ||
|
||
string(REGEX MATCH "define MIOPEN_VERSION_MAJOR +([0-9]+)" MIOPEN_MAJOR_VERSION | ||
"${MIOPEN_VERSION_FILE_CONTENTS}") | ||
string(REGEX REPLACE "define MIOPEN_VERSION_MAJOR +([0-9]+)" "\\1" | ||
MIOPEN_MAJOR_VERSION "${MIOPEN_MAJOR_VERSION}") | ||
string(REGEX MATCH "define MIOPEN_VERSION_MINOR +([0-9]+)" MIOPEN_MINOR_VERSION | ||
"${MIOPEN_VERSION_FILE_CONTENTS}") | ||
string(REGEX REPLACE "define MIOPEN_VERSION_MINOR +([0-9]+)" "\\1" | ||
MIOPEN_MINOR_VERSION "${MIOPEN_MINOR_VERSION}") | ||
string(REGEX MATCH "define MIOPEN_VERSION_PATCH +([0-9]+)" MIOPEN_PATCH_VERSION | ||
"${MIOPEN_VERSION_FILE_CONTENTS}") | ||
string(REGEX REPLACE "define MIOPEN_VERSION_PATCH +([0-9]+)" "\\1" | ||
MIOPEN_PATCH_VERSION "${MIOPEN_PATCH_VERSION}") | ||
string(REGEX MATCH "define MIOPEN_VERSION_TWEAK +([0-9]+)" MIOPEN_TWEAK_VERSION | ||
"${MIOPEN_VERSION_FILE_CONTENTS}") | ||
string(REGEX REPLACE "define MIOPEN_VERSION_TWEAK +([0-9]+)" "\\1" | ||
MIOPEN_TWEAK_VERSION "${MIOPEN_TWEAK_VERSION}") | ||
|
||
if(NOT MIOPEN_MAJOR_VERSION) | ||
set(MIOPEN_VERSION "???") | ||
else() | ||
add_definitions("-DMIOPEN_MAJOR_VERSION=\"${MIOPEN_MAJOR_VERSION}\"") | ||
math(EXPR MIOPEN_VERSION | ||
"${MIOPEN_MAJOR_VERSION} * 1000 + | ||
${MIOPEN_MINOR_VERSION} * 10 + ${MIOPEN_PATCH_VERSION}") | ||
message(STATUS "Current MIOpen header is ${MIOPEN_INCLUDE_DIR}/miopen/miopen.h " | ||
"Current MIOpen version is v${MIOPEN_MAJOR_VERSION}.${MIOPEN_MINOR_VERSION}.${MIOPEN_PATCH_VERSION}. ") | ||
endif() | ||
endmacro() | ||
|
||
if(MIOPEN_FOUND) | ||
find_miopen_version(${MIOPEN_INCLUDE_DIR}/miopen/version.h) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
dd743a4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅Congratulation! Your pull request passed all required CI. You could ask reviewer(s) to approve and merge. 🎉