Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
856611cc
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2299
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看板
提交
856611cc
编写于
9月 07, 2017
作者:
F
fengjiayi
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' of
https://github.com/PaddlePaddle/Paddle
into dev_add_axis
上级
b6a46667
6e6f18bd
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
15 addition
and
5 deletion
+15
-5
.travis.yml
.travis.yml
+2
-3
CMakeLists.txt
CMakeLists.txt
+2
-2
paddle/utils/Util.cpp
paddle/utils/Util.cpp
+4
-0
paddle/utils/Util.h
paddle/utils/Util.h
+7
-0
未找到文件。
.travis.yml
浏览文件 @
856611cc
...
@@ -21,7 +21,6 @@ addons:
...
@@ -21,7 +21,6 @@ addons:
-
python
-
python
-
python-pip
-
python-pip
-
python2.7-dev
-
python2.7-dev
-
python-numpy
-
python-wheel
-
python-wheel
-
libboost-dev
-
libboost-dev
-
curl
-
curl
...
@@ -35,8 +34,8 @@ before_install:
...
@@ -35,8 +34,8 @@ before_install:
-
if [[ "$JOB" == "check_style" ]]; then sudo ln -s /usr/bin/clang-format-3.8 /usr/bin/clang-format; fi
-
if [[ "$JOB" == "check_style" ]]; then sudo ln -s /usr/bin/clang-format-3.8 /usr/bin/clang-format; fi
# Paddle is using protobuf 3.1 currently. Protobuf 3.2 breaks the compatibility. So we specify the python
# Paddle is using protobuf 3.1 currently. Protobuf 3.2 breaks the compatibility. So we specify the python
# protobuf version.
# protobuf version.
-
pip install -r $TRAVIS_BUILD_DIR/python/requirements.txt
-
sudo
pip install -r $TRAVIS_BUILD_DIR/python/requirements.txt
-
pip install wheel sphinx==1.5.6 recommonmark sphinx-rtd-theme==0.1.9 virtualenv pre-commit LinkChecker
-
sudo
pip install wheel sphinx==1.5.6 recommonmark sphinx-rtd-theme==0.1.9 virtualenv pre-commit LinkChecker
-
curl https://glide.sh/get | bash
-
curl https://glide.sh/get | bash
-
eval "$(GIMME_GO_VERSION=1.8.3 gimme)"
-
eval "$(GIMME_GO_VERSION=1.8.3 gimme)"
-
go get -u github.com/alecthomas/gometalinter
-
go get -u github.com/alecthomas/gometalinter
...
...
CMakeLists.txt
浏览文件 @
856611cc
...
@@ -65,8 +65,8 @@ if(NOT CMAKE_BUILD_TYPE)
...
@@ -65,8 +65,8 @@ if(NOT CMAKE_BUILD_TYPE)
endif
()
endif
()
if
(
ANDROID
)
if
(
ANDROID
)
if
(
${
CMAKE_SYSTEM_VERSION
}
VERSION_LESS
"
21
"
)
if
(
${
CMAKE_SYSTEM_VERSION
}
VERSION_LESS
"
16
"
)
message
(
FATAL_ERROR
"Unsupport standalone toolchains with Android API level lower than
21
"
)
message
(
FATAL_ERROR
"Unsupport standalone toolchains with Android API level lower than
16
"
)
endif
()
endif
()
set
(
WITH_GPU OFF CACHE STRING
set
(
WITH_GPU OFF CACHE STRING
...
...
paddle/utils/Util.cpp
浏览文件 @
856611cc
...
@@ -320,6 +320,9 @@ void loadFileList(const std::string& fileListFileName,
...
@@ -320,6 +320,9 @@ void loadFileList(const std::string& fileListFileName,
}
}
double
getMemoryUsage
()
{
double
getMemoryUsage
()
{
#if defined(__ANDROID__)
return
0.0
;
#else
FILE
*
fp
=
fopen
(
"/proc/meminfo"
,
"r"
);
FILE
*
fp
=
fopen
(
"/proc/meminfo"
,
"r"
);
CHECK
(
fp
)
<<
"failed to fopen /proc/meminfo"
;
CHECK
(
fp
)
<<
"failed to fopen /proc/meminfo"
;
size_t
bufsize
=
256
*
sizeof
(
char
);
size_t
bufsize
=
256
*
sizeof
(
char
);
...
@@ -357,6 +360,7 @@ double getMemoryUsage() {
...
@@ -357,6 +360,7 @@ double getMemoryUsage() {
delete
[]
buf
;
delete
[]
buf
;
double
usedMem
=
1.0
-
1.0
*
(
freeMem
+
bufMem
+
cacheMem
)
/
totalMem
;
double
usedMem
=
1.0
-
1.0
*
(
freeMem
+
bufMem
+
cacheMem
)
/
totalMem
;
return
usedMem
;
return
usedMem
;
#endif
}
}
SyncThreadPool
*
getGlobalSyncThreadPool
()
{
SyncThreadPool
*
getGlobalSyncThreadPool
()
{
...
...
paddle/utils/Util.h
浏览文件 @
856611cc
...
@@ -33,6 +33,13 @@ limitations under the License. */
...
@@ -33,6 +33,13 @@ limitations under the License. */
#include "Flags.h"
#include "Flags.h"
#include "hl_gpu.h"
#include "hl_gpu.h"
#if defined(__ANDROID__) && (__ANDROID_API__ < 21)
inline
int
rand_r
(
unsigned
int
*
seedp
)
{
(
void
)
seedp
;
return
rand
();
}
#endif
/**
/**
* Loop over the elements in a container
* Loop over the elements in a container
* TODO(yuyang18): It's this foreach useful? Why not use C++ 11 foreach,
* TODO(yuyang18): It's this foreach useful? Why not use C++ 11 foreach,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录