Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
0d46f518
P
Paddle
项目概览
Crayon鑫
/
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看板
提交
0d46f518
编写于
8月 23, 2018
作者:
T
tensor-tang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refine avx condition and warning
上级
f0f06992
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
33 addition
and
10 deletion
+33
-10
cmake/configure.cmake
cmake/configure.cmake
+14
-8
paddle/fluid/platform/CMakeLists.txt
paddle/fluid/platform/CMakeLists.txt
+1
-1
paddle/fluid/platform/cpu_info.h
paddle/fluid/platform/cpu_info.h
+1
-1
paddle/fluid/platform/init.cc
paddle/fluid/platform/init.cc
+17
-0
未找到文件。
cmake/configure.cmake
浏览文件 @
0d46f518
...
...
@@ -50,14 +50,20 @@ if(NOT WITH_PROFILER)
endif
(
NOT WITH_PROFILER
)
if
(
NOT CMAKE_CROSSCOMPILING
)
if
(
WITH_AVX AND AVX512F_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
}
)
elseif
(
SSE3_FOUND
)
set
(
SIMD_FLAG
${
SSE3_FLAG
}
)
set
(
SIMD_FLAG
)
if
(
WITH_AVX
)
if
(
AVX512F_FOUND
)
set
(
SIMD_FLAG
"
${
SIMD_FLAG
}
${
AVX512F_FLAG
}
"
)
endif
()
if
(
AVX2_FOUND
)
set
(
SIMD_FLAG
"
${
SIMD_FLAG
}
${
AVX2_FLAG
}
"
)
endif
()
if
(
AVX_FOUND
)
set
(
SIMD_FLAG
"
${
SIMD_FLAG
}
${
AVX_FLAG
}
"
)
endif
()
if
(
SSE3_FOUND
)
set
(
SIMD_FLAG
"
${
SIMD_FLAG
}
${
SSE3_FLAG
}
"
)
endif
()
endif
()
endif
()
...
...
paddle/fluid/platform/CMakeLists.txt
浏览文件 @
0d46f518
...
...
@@ -50,7 +50,7 @@ ENDIF()
# memcpy depends on device_context, here add deps individually for
# avoiding cycle dependencies
cc_library
(
device_context SRCS device_context.cc init.cc DEPS malloc
place eigen3 stringpiece cpu_helper framework_proto
${
GPU_CTX_DEPS
}
${
MKLDNN_CTX_DEPS
}
)
place eigen3 stringpiece cpu_helper
cpu_info
framework_proto
${
GPU_CTX_DEPS
}
${
MKLDNN_CTX_DEPS
}
)
nv_test
(
device_context_test SRCS device_context_test.cu DEPS device_context gpu_info
)
cc_test
(
init_test SRCS init_test.cc DEPS device_context
)
...
...
paddle/fluid/platform/cpu_info.h
浏览文件 @
0d46f518
...
...
@@ -51,7 +51,7 @@ typedef enum {
}
cpu_isa_t
;
// Instruction set architecture
// May I use some instruction
inline
bool
MayIUse
(
const
cpu_isa_t
cpu_isa
);
bool
MayIUse
(
const
cpu_isa_t
cpu_isa
);
}
// namespace jit
...
...
paddle/fluid/platform/init.cc
浏览文件 @
0d46f518
...
...
@@ -18,6 +18,7 @@ limitations under the License. */
#include "paddle/fluid/framework/operator.h"
#include "paddle/fluid/platform/cpu_helper.h"
#include "paddle/fluid/platform/cpu_info.h"
#include "paddle/fluid/platform/device_context.h"
#include "paddle/fluid/platform/init.h"
#include "paddle/fluid/platform/place.h"
...
...
@@ -120,6 +121,22 @@ void InitDevices(bool init_p2p, const std::vector<int> devices) {
#ifndef PADDLE_WITH_MKLDNN
platform
::
SetNumThreads
(
FLAGS_paddle_num_threads
);
#endif
if
(
platform
::
jit
::
MayIUse
(
platform
::
jit
::
avx512_common
))
{
#ifndef __AVX512F__
LOG
(
WARNING
)
<<
"AVX512F is available, Please re-compile on local machine"
;
#endif
}
if
(
platform
::
jit
::
MayIUse
(
platform
::
jit
::
avx2
))
{
#ifndef __AVX2__
LOG
(
WARNING
)
<<
"AVX2 is available, Please re-compile on local machine"
;
#endif
}
if
(
platform
::
jit
::
MayIUse
(
platform
::
jit
::
avx
))
{
#ifndef __AVX__
LOG
(
WARNING
)
<<
"AVX is available, Please re-compile on local machine"
;
#endif
}
}
void
InitGLOG
(
const
std
::
string
&
prog_name
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录