Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OPTHREE
Paddle
提交
fa135bbf
P
Paddle
项目概览
OPTHREE
/
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
fa135bbf
编写于
12月 18, 2018
作者:
P
peizhilin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix the mkl build script on windows
test=develop
上级
b601f2de
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
48 addition
and
45 deletion
+48
-45
cmake/external/mklml.cmake
cmake/external/mklml.cmake
+27
-31
paddle/fluid/operators/elementwise/elementwise_mul_mkldnn_op.cc
.../fluid/operators/elementwise/elementwise_mul_mkldnn_op.cc
+3
-0
paddle/fluid/operators/math/detail/lstm_cpu_kernel.h
paddle/fluid/operators/math/detail/lstm_cpu_kernel.h
+6
-0
paddle/fluid/operators/math/jit_gen.h
paddle/fluid/operators/math/jit_gen.h
+3
-0
python/CMakeLists.txt
python/CMakeLists.txt
+3
-14
python/setup.py.in
python/setup.py.in
+6
-0
未找到文件。
cmake/external/mklml.cmake
浏览文件 @
fa135bbf
...
@@ -44,40 +44,36 @@ else()
...
@@ -44,40 +44,36 @@ else()
endif
()
endif
()
SET
(
CMAKE_INSTALL_RPATH
"
${
CMAKE_INSTALL_RPATH
}
"
"
${
MKLML_ROOT
}
/lib"
)
SET
(
CMAKE_INSTALL_RPATH
"
${
CMAKE_INSTALL_RPATH
}
"
"
${
MKLML_ROOT
}
/lib"
)
if
(
WIN32
)
IF
((
NOT DEFINED MKLML_VER
)
OR
(
NOT DEFINED MKLML_URL
))
MESSAGE
(
WARNING
MESSAGE
(
STATUS
"use pre defined download url"
)
"Please download the MKLML and and put it at "
${
THIRD_PARTY_PATH
}
/install/mklml
)
if
(
WIN32
)
else
()
SET
(
MKLML_VER
"mklml_win_2019.0.1.20180928"
CACHE STRING
""
FORCE
)
SET
(
MKLML_PROJECT
"extern_mklml"
)
SET
(
MKLML_URL
"https://github.com/intel/mkl-dnn/releases/download/v0.17/
${
MKLML_VER
}
.zip"
CACHE STRING
""
FORCE
)
IF
((
NOT DEFINED MKLML_VER
)
OR
(
NOT DEFINED MKLML_URL
))
else
()
MESSAGE
(
STATUS
"use pre defined download url"
)
SET
(
MKLML_VER
"mklml_lnx_2019.0.20180710"
CACHE STRING
""
FORCE
)
SET
(
MKLML_VER
"mklml_lnx_2019.0.20180710"
CACHE STRING
""
FORCE
)
SET
(
MKLML_URL
"http://paddlepaddledeps.cdn.bcebos.com/
${
MKLML_VER
}
.tgz"
CACHE STRING
""
FORCE
)
SET
(
MKLML_URL
"http://paddlepaddledeps.cdn.bcebos.com/
${
MKLML_VER
}
.tgz"
CACHE STRING
""
FORCE
)
ENDIF
()
ENDIF
()
MESSAGE
(
STATUS
"MKLML_VER:
${
MKLML_VER
}
, MKLML_URL:
${
MKLML_URL
}
"
)
SET
(
MKLML_SOURCE_DIR
"
${
THIRD_PARTY_PATH
}
/mklml"
)
SET
(
MKLML_DOWNLOAD_DIR
"
${
MKLML_SOURCE_DIR
}
/src/
${
MKLML_PROJECT
}
"
)
FILE
(
WRITE
${
MKLML_DOWNLOAD_DIR
}
/CMakeLists.txt
"PROJECT(MKLML)
\n
"
"cmake_minimum_required(VERSION 3.0)
\n
"
"install(DIRECTORY
${
MKLML_VER
}
/include
${
MKLML_VER
}
/lib
\n
"
" DESTINATION
${
MKLML_DST_DIR
}
)
\n
"
)
ExternalProject_Add
(
${
MKLML_PROJECT
}
${
EXTERNAL_PROJECT_LOG_ARGS
}
PREFIX
${
MKLML_SOURCE_DIR
}
DOWNLOAD_DIR
${
MKLML_DOWNLOAD_DIR
}
DOWNLOAD_COMMAND wget --no-check-certificate
${
MKLML_URL
}
-c -q -O
${
MKLML_VER
}
.tgz
&& tar zxf
${
MKLML_VER
}
.tgz
DOWNLOAD_NO_PROGRESS 1
UPDATE_COMMAND
""
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=
${
MKLML_INSTALL_ROOT
}
CMAKE_CACHE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=
${
MKLML_INSTALL_ROOT
}
)
endif
()
endif
()
SET
(
MKLML_PROJECT
"extern_mklml"
)
MESSAGE
(
STATUS
"MKLML_VER:
${
MKLML_VER
}
, MKLML_URL:
${
MKLML_URL
}
"
)
SET
(
MKLML_SOURCE_DIR
"
${
THIRD_PARTY_PATH
}
/mklml"
)
SET
(
MKLML_DOWNLOAD_DIR
"
${
MKLML_SOURCE_DIR
}
/src/
${
MKLML_PROJECT
}
"
)
ExternalProject_Add
(
${
MKLML_PROJECT
}
${
EXTERNAL_PROJECT_LOG_ARGS
}
PREFIX
${
MKLML_SOURCE_DIR
}
URL
${
MKLML_URL
}
DOWNLOAD_DIR
${
MKLML_DOWNLOAD_DIR
}
DOWNLOAD_NO_PROGRESS 1
CONFIGURE_COMMAND
""
BUILD_COMMAND
""
UPDATE_COMMAND
""
INSTALL_COMMAND
${
CMAKE_COMMAND
}
-E copy_directory
${
MKLML_DOWNLOAD_DIR
}
/include
${
MKLML_INC_DIR
}
&&
${
CMAKE_COMMAND
}
-E copy_directory
${
MKLML_DOWNLOAD_DIR
}
/lib
${
MKLML_LIB_DIR
}
)
INCLUDE_DIRECTORIES
(
${
MKLML_INC_DIR
}
)
INCLUDE_DIRECTORIES
(
${
MKLML_INC_DIR
}
)
...
...
paddle/fluid/operators/elementwise/elementwise_mul_mkldnn_op.cc
浏览文件 @
fa135bbf
...
@@ -19,6 +19,9 @@ limitations under the License. */
...
@@ -19,6 +19,9 @@ limitations under the License. */
#include "paddle/fluid/platform/mkldnn_helper.h"
#include "paddle/fluid/platform/mkldnn_helper.h"
#include "paddle/fluid/operators/math/jit_kernel.h"
#include "paddle/fluid/operators/math/jit_kernel.h"
#if defined(_WIN32) && defined(_WINSOCKAPI_)
#define _WINSOCK2API_
/* Prevent inclusion of winsock2.h */
#endif
#include "xbyak/xbyak.h"
#include "xbyak/xbyak.h"
#include "xbyak/xbyak_util.h"
#include "xbyak/xbyak_util.h"
...
...
paddle/fluid/operators/math/detail/lstm_cpu_kernel.h
浏览文件 @
fa135bbf
...
@@ -17,6 +17,12 @@ limitations under the License. */
...
@@ -17,6 +17,12 @@ limitations under the License. */
#include "paddle/fluid/operators/math/detail/activation_functions.h"
#include "paddle/fluid/operators/math/detail/activation_functions.h"
#include "paddle/fluid/operators/math/lstm_compute.h"
#include "paddle/fluid/operators/math/lstm_compute.h"
#if defined(_WIN32)
#if defined(__AVX2__) || defined(__AVX__)
inline
__m256
operator
+=
(
__m256
a
,
__m256
b
)
{
return
_mm256_add_ps
(
a
,
b
);
}
#endif
#endif
namespace
paddle
{
namespace
paddle
{
namespace
operators
{
namespace
operators
{
namespace
math
{
namespace
math
{
...
...
paddle/fluid/operators/math/jit_gen.h
浏览文件 @
fa135bbf
...
@@ -18,6 +18,9 @@ limitations under the License. */
...
@@ -18,6 +18,9 @@ limitations under the License. */
#include <type_traits>
#include <type_traits>
#include "paddle/fluid/platform/macros.h"
#include "paddle/fluid/platform/macros.h"
#if defined(_WIN32) && defined(_WINSOCKAPI_)
#define _WINSOCK2API_
/* Prevent inclusion of winsock2.h */
#endif
#define XBYAK_USE_MMAP_ALLOCATOR
#define XBYAK_USE_MMAP_ALLOCATOR
#include "xbyak/xbyak.h"
#include "xbyak/xbyak.h"
#include "xbyak/xbyak_util.h"
#include "xbyak/xbyak_util.h"
...
...
python/CMakeLists.txt
浏览文件 @
fa135bbf
...
@@ -49,23 +49,12 @@ IF(WIN32)
...
@@ -49,23 +49,12 @@ IF(WIN32)
# Python would use the .pyd by default under Windows series platform
# Python would use the .pyd by default under Windows series platform
set
(
FLUID_DST_DIR
${
PADDLE_BINARY_DIR
}
/python/paddle/fluid/
)
set
(
FLUID_DST_DIR
${
PADDLE_BINARY_DIR
}
/python/paddle/fluid/
)
set
(
FLUID_CORE
${
FLUID_DST_DIR
}
/core.pyd
)
set
(
FLUID_CORE
${
FLUID_DST_DIR
}
/core.pyd
)
if
(
NOT WITH_MKLDNN
)
get_filename_component
(
openblas_refpath
${
CBLAS_LIBRARIES
}
DIRECTORY
)
add_custom_command
(
OUTPUT
${
FLUID_CORE
}
COMMAND cmake -E copy $<TARGET_FILE:paddle_pybind>
${
FLUID_CORE
}
COMMAND cmake -E copy
${
openblas_refpath
}
/openblas.dll
${
FLUID_DST_DIR
}
DEPENDS paddle_pybind
)
else
(
NOT WITH_MKLDNN
)
add_custom_command
(
OUTPUT
${
FLUID_CORE
}
COMMAND cmake -E copy $<TARGET_FILE:paddle_pybind>
${
FLUID_CORE
}
DEPENDS paddle_pybind
)
endif
(
NOT WITH_MKLDNN
)
ELSE
()
ELSE
()
set
(
FLUID_CORE
${
PADDLE_BINARY_DIR
}
/python/paddle/fluid/core.so
)
set
(
FLUID_CORE
${
PADDLE_BINARY_DIR
}
/python/paddle/fluid/core.so
)
add_custom_command
(
OUTPUT
${
FLUID_CORE
}
COMMAND cmake -E copy $<TARGET_FILE:paddle_pybind>
${
FLUID_CORE
}
DEPENDS paddle_pybind
)
ENDIF
()
ENDIF
()
add_custom_command
(
OUTPUT
${
FLUID_CORE
}
COMMAND cmake -E copy $<TARGET_FILE:paddle_pybind>
${
FLUID_CORE
}
DEPENDS paddle_pybind
)
add_custom_target
(
copy_paddle_pybind ALL DEPENDS
${
FLUID_CORE
}
)
add_custom_target
(
copy_paddle_pybind ALL DEPENDS
${
FLUID_CORE
}
)
IF
(
WIN32
)
IF
(
WIN32
)
...
...
python/setup.py.in
浏览文件 @
fa135bbf
...
@@ -166,6 +166,12 @@ if '${WITH_MKL}' == 'ON':
...
@@ -166,6 +166,12 @@ if '${WITH_MKL}' == 'ON':
shutil.copy('${MKLML_SHARED_LIB}', libs_path)
shutil.copy('${MKLML_SHARED_LIB}', libs_path)
shutil.copy('${MKLML_SHARED_IOMP_LIB}', libs_path)
shutil.copy('${MKLML_SHARED_IOMP_LIB}', libs_path)
package_data['paddle.libs']+=[('libmklml_intel' if os.name != 'nt' else 'mklml') + ext_name, ('libiomp5' if os.name != 'nt' else 'libiomp5md') + ext_name]
package_data['paddle.libs']+=[('libmklml_intel' if os.name != 'nt' else 'mklml') + ext_name, ('libiomp5' if os.name != 'nt' else 'libiomp5md') + ext_name]
else:
# copy the openblas.dll
if os.name == 'nt':
shutil.copy('${CBLAS_LIBRARIES}', libs_path)
package_data['paddle.libs']+=['openblas' + ext_name]
if '${WITH_MKLDNN}' == 'ON':
if '${WITH_MKLDNN}' == 'ON':
if '${CMAKE_BUILD_TYPE}' == 'Release':
if '${CMAKE_BUILD_TYPE}' == 'Release':
if os.name != 'nt':
if os.name != 'nt':
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录