Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
3c9755bb
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2302
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
3c9755bb
编写于
6月 26, 2019
作者:
T
Tao Luo
提交者:
GitHub
6月 26, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove unused jemalloc option (#18314)
test=develop
上级
bd61d899
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
0 addition
and
58 deletion
+0
-58
CMakeLists.txt
CMakeLists.txt
+0
-7
cmake/FindJeMalloc.cmake
cmake/FindJeMalloc.cmake
+0
-28
cmake/generic.cmake
cmake/generic.cmake
+0
-4
paddle/fluid/memory/allocation/legacy_allocator.cc
paddle/fluid/memory/allocation/legacy_allocator.cc
+0
-17
paddle/scripts/paddle_build.sh
paddle/scripts/paddle_build.sh
+0
-2
未找到文件。
CMakeLists.txt
浏览文件 @
3c9755bb
...
...
@@ -63,7 +63,6 @@ option(WITH_ANAKIN "Compile with Anakin library" OFF)
option
(
WITH_AMD_GPU
"Compile PaddlePaddle with AMD GPU"
OFF
)
option
(
WITH_NGRAPH
"Compile PaddlePaddle with nGraph support."
OFF
)
option
(
WITH_PROFILER
"Compile PaddlePaddle with GPU profiler and gperftools"
OFF
)
option
(
WITH_JEMALLOC
"Compile PaddlePaddle with jemalloc"
OFF
)
option
(
WITH_COVERAGE
"Compile PaddlePaddle with code coverage"
OFF
)
option
(
COVERALLS_UPLOAD
"Package code coverage data to coveralls"
OFF
)
option
(
WITH_PSLIB
"Compile with pslib support"
OFF
)
...
...
@@ -219,12 +218,6 @@ if (WITH_PROFILER)
add_definitions
(
-DWITH_GPERFTOOLS
)
endif
()
if
(
WITH_JEMALLOC
)
find_package
(
JeMalloc REQUIRED
)
include_directories
(
${
JEMALLOC_INCLUDE_DIR
}
)
add_definitions
(
-DPADDLE_WITH_JEMALLOC
)
endif
()
include
(
generic
)
# simplify cmake module
include
(
package
)
# set paddle packages
include
(
ccache
)
# set ccache for compilation
...
...
cmake/FindJeMalloc.cmake
已删除
100644 → 0
浏览文件 @
bd61d899
# - Find JeMalloc library
# Find the native JeMalloc includes and library
#
# JEMALLOC_INCLUDE_DIR - where to find jemalloc.h, etc.
# JEMALLOC_LIBRARIES - List of libraries when using jemalloc.
# JEMALLOC_FOUND - True if jemalloc found.
find_path
(
JEMALLOC_INCLUDE_DIR
NAMES jemalloc/jemalloc.h
HINTS
${
JEMALLOC_ROOT_DIR
}
/include
)
find_library
(
JEMALLOC_LIBRARIES
NAMES jemalloc
HINTS
${
JEMALLOC_ROOT_DIR
}
/lib
)
include
(
FindPackageHandleStandardArgs
)
find_package_handle_standard_args
(
jemalloc DEFAULT_MSG JEMALLOC_LIBRARIES JEMALLOC_INCLUDE_DIR
)
mark_as_advanced
(
JEMALLOC_LIBRARIES
JEMALLOC_INCLUDE_DIR
)
if
(
JEMALLOC_FOUND
)
add_library
(
jemalloc::jemalloc UNKNOWN IMPORTED
)
set_target_properties
(
jemalloc::jemalloc PROPERTIES
IMPORTED_LOCATION
${
JEMALLOC_LIBRARIES
}
INTERFACE_INCLUDE_DIRECTORIES
"
${
JEMALLOC_INCLUDE_DIR
}
"
)
endif
()
cmake/generic.cmake
浏览文件 @
3c9755bb
...
...
@@ -115,10 +115,6 @@ function(common_link TARGET_NAME)
if
(
WITH_PROFILER
)
target_link_libraries
(
${
TARGET_NAME
}
gperftools::profiler
)
endif
()
if
(
WITH_JEMALLOC
)
target_link_libraries
(
${
TARGET_NAME
}
jemalloc::jemalloc
)
endif
()
endfunction
()
...
...
paddle/fluid/memory/allocation/legacy_allocator.cc
浏览文件 @
3c9755bb
...
...
@@ -17,10 +17,6 @@
#include <utility>
#include <vector>
#ifdef PADDLE_WITH_JEMALLOC
#include <jemalloc/jemalloc.h>
#endif
#include "glog/logging.h"
#include "paddle/fluid/memory/allocation/legacy_allocator.h"
#include "paddle/fluid/memory/detail/buddy_allocator.h"
...
...
@@ -103,11 +99,7 @@ struct NaiveAllocator {
template
<
>
void
*
Alloc
<
platform
::
CPUPlace
>
(
const
platform
::
CPUPlace
&
place
,
size_t
size
)
{
VLOG
(
10
)
<<
"Allocate "
<<
size
<<
" bytes on "
<<
platform
::
Place
(
place
);
#ifdef PADDLE_WITH_JEMALLOC
void
*
p
=
malloc
(
size
);
#else
void
*
p
=
GetCPUBuddyAllocator
()
->
Alloc
(
size
);
#endif
if
(
FLAGS_init_allocated_mem
)
{
memset
(
p
,
0xEF
,
size
);
}
...
...
@@ -119,21 +111,12 @@ template <>
void
Free
<
platform
::
CPUPlace
>
(
const
platform
::
CPUPlace
&
place
,
void
*
p
,
size_t
size
)
{
VLOG
(
10
)
<<
"Free pointer="
<<
p
<<
" on "
<<
platform
::
Place
(
place
);
#ifdef PADDLE_WITH_JEMALLOC
free
(
p
);
#else
GetCPUBuddyAllocator
()
->
Free
(
p
);
#endif
}
template
<
>
size_t
Used
<
platform
::
CPUPlace
>
(
const
platform
::
CPUPlace
&
place
)
{
#ifdef PADDLE_WITH_JEMALLOC
// fake the result of used memory when PADDLE_WITH_JEMALLOC is ON
return
0U
;
#else
return
GetCPUBuddyAllocator
()
->
Used
();
#endif
}
#ifdef PADDLE_WITH_CUDA
...
...
paddle/scripts/paddle_build.sh
浏览文件 @
3c9755bb
...
...
@@ -207,7 +207,6 @@ function cmake_base() {
-DANAKIN_BUILD_CROSS_PLANTFORM=
${
ANAKIN_BUILD_CROSS_PLANTFORM
:ON
}
-DPY_VERSION=
${
PY_VERSION
:-
2
.7
}
-DCMAKE_INSTALL_PREFIX=
${
INSTALL_PREFIX
:-
/paddle/build
}
-DWITH_JEMALLOC=
${
WITH_JEMALLOC
:-
OFF
}
-DWITH_GRPC=
${
grpc_flag
}
========================================
EOF
...
...
@@ -242,7 +241,6 @@ EOF
-DANAKIN_BUILD_CROSS_PLANTFORM
=
${
ANAKIN_BUILD_CROSS_PLANTFORM
:ON
}
\
-DPY_VERSION
=
${
PY_VERSION
:-
2
.7
}
\
-DCMAKE_INSTALL_PREFIX
=
${
INSTALL_PREFIX
:-
/paddle/build
}
\
-DWITH_JEMALLOC
=
${
WITH_JEMALLOC
:-
OFF
}
\
-DWITH_GRPC
=
${
grpc_flag
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录