Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into add_fused_emb_seq_pool_op
test=developrevert-15207-remove_op_handle_lock_and_fix_var
commit
920d4a8b78
@ -0,0 +1,63 @@
|
||||
# Tries to find Gperftools.
|
||||
#
|
||||
# Usage of this module as follows:
|
||||
#
|
||||
# find_package(Gperftools)
|
||||
#
|
||||
# Variables used by this module, they can change the default behaviour and need
|
||||
# to be set before calling find_package:
|
||||
#
|
||||
# Gperftools_ROOT_DIR Set this variable to the root installation of
|
||||
# Gperftools if the module has problems finding
|
||||
# the proper installation path.
|
||||
#
|
||||
# Variables defined by this module:
|
||||
#
|
||||
# GPERFTOOLS_FOUND System has Gperftools libs/headers
|
||||
# GPERFTOOLS_LIBRARIES The Gperftools libraries (tcmalloc & profiler)
|
||||
# GPERFTOOLS_INCLUDE_DIR The location of Gperftools headers
|
||||
|
||||
find_library(GPERFTOOLS_TCMALLOC
|
||||
NAMES tcmalloc
|
||||
HINTS ${Gperftools_ROOT_DIR}/lib)
|
||||
|
||||
find_library(GPERFTOOLS_PROFILER
|
||||
NAMES profiler
|
||||
HINTS ${Gperftools_ROOT_DIR}/lib)
|
||||
|
||||
find_library(GPERFTOOLS_TCMALLOC_AND_PROFILER
|
||||
NAMES tcmalloc_and_profiler
|
||||
HINTS ${Gperftools_ROOT_DIR}/lib)
|
||||
|
||||
find_path(GPERFTOOLS_INCLUDE_DIR
|
||||
NAMES gperftools/heap-profiler.h
|
||||
HINTS ${Gperftools_ROOT_DIR}/include)
|
||||
|
||||
set(GPERFTOOLS_LIBRARIES ${GPERFTOOLS_TCMALLOC_AND_PROFILER})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(
|
||||
Gperftools
|
||||
DEFAULT_MSG
|
||||
GPERFTOOLS_LIBRARIES
|
||||
GPERFTOOLS_INCLUDE_DIR)
|
||||
|
||||
mark_as_advanced(
|
||||
Gperftools_ROOT_DIR
|
||||
GPERFTOOLS_TCMALLOC
|
||||
GPERFTOOLS_PROFILER
|
||||
GPERFTOOLS_TCMALLOC_AND_PROFILER
|
||||
GPERFTOOLS_LIBRARIES
|
||||
GPERFTOOLS_INCLUDE_DIR)
|
||||
|
||||
# create IMPORTED targets
|
||||
if (Gperftools_FOUND AND NOT TARGET gperftools::tcmalloc)
|
||||
add_library(gperftools::tcmalloc UNKNOWN IMPORTED)
|
||||
set_target_properties(gperftools::tcmalloc PROPERTIES
|
||||
IMPORTED_LOCATION ${GPERFTOOLS_TCMALLOC}
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${GPERFTOOLS_INCLUDE_DIR}")
|
||||
add_library(gperftools::profiler UNKNOWN IMPORTED)
|
||||
set_target_properties(gperftools::profiler PROPERTIES
|
||||
IMPORTED_LOCATION ${GPERFTOOLS_PROFILER}
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${GPERFTOOLS_INCLUDE_DIR}")
|
||||
endif()
|
@ -0,0 +1,31 @@
|
||||
include(ExternalProject)
|
||||
|
||||
set(DLPACK_SOURCE_DIR ${THIRD_PARTY_PATH}/dlpack)
|
||||
set(DLPACK_INCLUDE_DIR ${DLPACK_SOURCE_DIR}/src/extern_dlpack/include)
|
||||
|
||||
include_directories(${DLPACK_INCLUDE_DIR})
|
||||
|
||||
ExternalProject_Add(
|
||||
extern_dlpack
|
||||
${EXTERNAL_PROJECT_LOG_ARGS}
|
||||
GIT_REPOSITORY "https://github.com/dmlc/dlpack.git"
|
||||
GIT_TAG "v0.2"
|
||||
PREFIX ${DLPACK_SOURCE_DIR}
|
||||
UPDATE_COMMAND ""
|
||||
CONFIGURE_COMMAND ""
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND ""
|
||||
TEST_COMMAND ""
|
||||
)
|
||||
|
||||
if(${CMAKE_VERSION} VERSION_LESS "3.3.0")
|
||||
set(dummyfile ${CMAKE_CURRENT_BINARY_DIR}/dlpack_dummy.c)
|
||||
file(WRITE ${dummyfile} "const char *dummy = \"${dummyfile}\";")
|
||||
add_library(dlpack STATIC ${dummyfile})
|
||||
else()
|
||||
add_library(dlpack INTERFACE)
|
||||
endif()
|
||||
|
||||
add_dependencies(dlpack extern_dlpack)
|
||||
|
||||
LIST(APPEND external_project_dependencies dlpack)
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue