Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
c6571b3a
P
Paddle
项目概览
机器未来
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
c6571b3a
编写于
11月 08, 2018
作者:
T
tensor-tang
提交者:
GitHub
11月 08, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #14287 from tensor-tang/v1.1/avxfix
cherry pick avxfix to 1.1
上级
cac82f80
979c7f8c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
40 addition
and
14 deletion
+40
-14
cmake/configure.cmake
cmake/configure.cmake
+1
-5
paddle/fluid/platform/init.cc
paddle/fluid/platform/init.cc
+39
-9
未找到文件。
cmake/configure.cmake
浏览文件 @
c6571b3a
...
@@ -50,11 +50,7 @@ if(NOT WITH_PROFILER)
...
@@ -50,11 +50,7 @@ if(NOT WITH_PROFILER)
endif
(
NOT WITH_PROFILER
)
endif
(
NOT WITH_PROFILER
)
if
(
NOT CMAKE_CROSSCOMPILING
)
if
(
NOT CMAKE_CROSSCOMPILING
)
if
(
WITH_AVX AND AVX512F_FOUND
)
if
(
WITH_AVX AND AVX_FOUND
)
set
(
SIMD_FLAG
${
AVX512F_FLAG
}
)
elseif
(
WITH_AVX AND AVX2_FOUND
)
set
(
SIMD_FLAG
${
AVX2_FLAG
}
)
elseif
(
WITH_AVX AND AVX_FOUND
)
set
(
SIMD_FLAG
${
AVX_FLAG
}
)
set
(
SIMD_FLAG
${
AVX_FLAG
}
)
elseif
(
SSE3_FOUND
)
elseif
(
SSE3_FOUND
)
set
(
SIMD_FLAG
${
SSE3_FLAG
}
)
set
(
SIMD_FLAG
${
SSE3_FLAG
}
)
...
...
paddle/fluid/platform/init.cc
浏览文件 @
c6571b3a
...
@@ -116,21 +116,51 @@ void InitDevices(bool init_p2p, const std::vector<int> devices) {
...
@@ -116,21 +116,51 @@ void InitDevices(bool init_p2p, const std::vector<int> devices) {
platform
::
SetNumThreads
(
FLAGS_paddle_num_threads
);
platform
::
SetNumThreads
(
FLAGS_paddle_num_threads
);
#endif
#endif
if
(
platform
::
jit
::
MayIUse
(
platform
::
jit
::
avx512f
))
{
#if !defined(_WIN32) && !defined(__APPLE__) && !defined(__OSX__)
#ifndef __AVX512F__
if
(
platform
::
jit
::
MayIUse
(
platform
::
jit
::
avx
))
{
LOG
(
WARNING
)
<<
"AVX512F is available, Please re-compile on local machine"
;
#ifndef __AVX__
LOG
(
WARNING
)
<<
"AVX is available, Please re-compile on local machine"
;
#endif
#endif
}
}
if
(
platform
::
jit
::
MayIUse
(
platform
::
jit
::
avx2
))
{
#ifndef __AVX2__
// Throw some informations when CPU instructions mismatch.
LOG
(
WARNING
)
<<
"AVX2 is available, Please re-compile on local machine"
;
#define AVX_GUIDE(compiletime, runtime) \
LOG(FATAL) \
<< "This version is compiled on higher instruction(" #compiletime \
") system, you may encounter illegal instruction error running on" \
" your local CPU machine. Please reinstall the " #runtime \
" version or compile from source code."
#ifdef __AVX512F__
if
(
!
platform
::
jit
::
MayIUse
(
platform
::
jit
::
avx512f
))
{
if
(
platform
::
jit
::
MayIUse
(
platform
::
jit
::
avx2
))
{
AVX_GUIDE
(
AVX512
,
AVX2
);
}
else
if
(
platform
::
jit
::
MayIUse
(
platform
::
jit
::
avx
))
{
AVX_GUIDE
(
AVX512
,
AVX
);
}
else
{
AVX_GUIDE
(
AVX512
,
NonAVX
);
}
}
#endif
#endif
#ifdef __AVX2__
if
(
!
platform
::
jit
::
MayIUse
(
platform
::
jit
::
avx2
))
{
if
(
platform
::
jit
::
MayIUse
(
platform
::
jit
::
avx
))
{
AVX_GUIDE
(
AVX2
,
AVX
);
}
else
{
AVX_GUIDE
(
AVX2
,
NonAVX
);
}
}
}
if
(
platform
::
jit
::
MayIUse
(
platform
::
jit
::
avx
))
{
#ifndef __AVX__
LOG
(
WARNING
)
<<
"AVX is available, Please re-compile on local machine"
;
#endif
#endif
#ifdef __AVX__
if
(
!
platform
::
jit
::
MayIUse
(
platform
::
jit
::
avx
))
{
AVX_GUIDE
(
AVX
,
NonAVX
);
}
}
#endif
#undef AVX_GUIDE
#endif
}
}
void
InitGLOG
(
const
std
::
string
&
prog_name
)
{
void
InitGLOG
(
const
std
::
string
&
prog_name
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录