Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
44ee251f
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看板
未验证
提交
44ee251f
编写于
2月 23, 2021
作者:
Z
Zhou Wei
提交者:
GitHub
2月 23, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix UNIX cmake problem (#31113)
上级
a60d93fb
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
18 addition
and
25 deletion
+18
-25
cmake/generic.cmake
cmake/generic.cmake
+2
-4
paddle/scripts/paddle_build.bat
paddle/scripts/paddle_build.bat
+2
-2
python/paddle/fluid/tests/CMakeLists.txt
python/paddle/fluid/tests/CMakeLists.txt
+1
-1
python/paddle/fluid/tests/custom_op/CMakeLists.txt
python/paddle/fluid/tests/custom_op/CMakeLists.txt
+1
-1
python/paddle/fluid/tests/custom_op/test_dispatch.py
python/paddle/fluid/tests/custom_op/test_dispatch.py
+6
-8
python/paddle/fluid/tests/custom_op/test_simple_custom_op_jit.py
...paddle/fluid/tests/custom_op/test_simple_custom_op_jit.py
+6
-8
python/paddle/utils/cpp_extension/extension_utils.py
python/paddle/utils/cpp_extension/extension_utils.py
+0
-1
未找到文件。
cmake/generic.cmake
浏览文件 @
44ee251f
...
...
@@ -794,16 +794,14 @@ function(py_test TARGET_NAME)
if
(
WITH_COVERAGE AND
NOT
(
WITH_INCREMENTAL_COVERAGE AND
"$ENV{PADDLE_GIT_DIFF_PY_FILE}"
STREQUAL
""
))
add_test
(
NAME
${
TARGET_NAME
}
COMMAND
${
CMAKE_COMMAND
}
-E env FLAGS_init_allocated_mem=true FLAGS_cudnn_deterministic=true
FLAGS_cpu_deterministic=true
PYTHONPATH=
${
PADDLE_BINARY_DIR
}
/python
${
py_test_ENVS
}
FLAGS_cpu_deterministic=true
${
py_test_ENVS
}
COVERAGE_FILE=
${
PADDLE_BINARY_DIR
}
/python-coverage.data
${
PYTHON_EXECUTABLE
}
-m coverage run --branch -p
${
py_test_SRCS
}
${
py_test_ARGS
}
WORKING_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
)
else
()
add_test
(
NAME
${
TARGET_NAME
}
COMMAND
${
CMAKE_COMMAND
}
-E env FLAGS_init_allocated_mem=true FLAGS_cudnn_deterministic=true
FLAGS_cpu_deterministic=true
PYTHONPATH=
${
PADDLE_BINARY_DIR
}
/python
${
py_test_ENVS
}
FLAGS_cpu_deterministic=true
${
py_test_ENVS
}
${
PYTHON_EXECUTABLE
}
-u
${
py_test_SRCS
}
${
py_test_ARGS
}
WORKING_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
)
endif
()
...
...
paddle/scripts/paddle_build.bat
浏览文件 @
44ee251f
...
...
@@ -114,8 +114,8 @@ rem ------pre install python requirement----------
where
python
where
pip
pip
install
wheel
--user
pip
install
-
-force-reinstall -r
%work_dir%
\python
\requirements.txt
--user
pip
install
-
-force-reinstall -r
%work_dir%
\python\unittest_py
\requirements.txt
--user
pip
install
-
r
%work_dir%
\python\unittest_py
\requirements.txt
--user
pip
install
-
r
%work_dir%
\python
\requirements.txt
--user
if
%ERRORLEVEL%
NEQ
0
(
echo
pip
install
requirements
.txt
failed
!
exit
/b
7
...
...
python/paddle/fluid/tests/CMakeLists.txt
浏览文件 @
44ee251f
...
...
@@ -10,7 +10,7 @@ add_subdirectory(unittests)
add_subdirectory
(
book
)
# TODO: support New Custom OP on Mac
if
(
L
inux
)
if
(
L
INUX
)
add_subdirectory
(
custom_op
)
endif
()
...
...
python/paddle/fluid/tests/custom_op/CMakeLists.txt
浏览文件 @
44ee251f
...
...
@@ -13,7 +13,7 @@ py_test(test_sysconfig SRCS test_sysconfig.py)
py_test
(
test_dispatch SRCS test_dispatch.py
)
set_tests_properties
(
test_dispatch PROPERTIES TIMEOUT 180
)
if
(
NOT L
inux
)
if
(
NOT L
INUX
)
return
()
endif
()
...
...
python/paddle/fluid/tests/custom_op/test_dispatch.py
浏览文件 @
44ee251f
...
...
@@ -20,20 +20,18 @@ from paddle.utils.cpp_extension import load, get_build_directory
from
utils
import
paddle_includes
,
extra_compile_args
from
paddle.utils.cpp_extension.extension_utils
import
run_cmd
# Because
the shared lib already exists in the cache dir,
#
it will not be compiled again unless the cache dir is clear
ed.
# Because
Windows don't use docker, the shared lib already exists in the
#
cache dir, it will not be compiled again unless the shared lib is remov
ed.
if
os
.
name
==
'nt'
:
cmd
=
'rmdir {} /s/q'
.
format
(
get_build_directory
())
else
:
cmd
=
'rm -rf {}'
.
format
(
get_build_directory
())
run_cmd
(
cmd
,
True
)
cmd
=
'del {}
\\
dispatch_op.pyd'
.
format
(
get_build_directory
())
run_cmd
(
cmd
,
True
)
dispatch_op
=
load
(
name
=
'dispatch_op'
,
sources
=
[
'dispatch_test_op.cc'
],
extra_include_paths
=
paddle_includes
,
# add for Coverage CI
extra_cflags
=
extra_compile_args
)
# add for Coverage CI
extra_cflags
=
extra_compile_args
,
# add for Coverage CI
verbose
=
True
)
class
TestJitDispatch
(
unittest
.
TestCase
):
...
...
python/paddle/fluid/tests/custom_op/test_simple_custom_op_jit.py
浏览文件 @
44ee251f
...
...
@@ -22,21 +22,19 @@ from paddle.utils.cpp_extension.extension_utils import run_cmd
from
utils
import
paddle_includes
,
extra_compile_args
from
test_simple_custom_op_setup
import
relu2_dynamic
,
relu2_static
# Because
the shared lib already exists in the cache dir,
#
it will not be compiled again unless the cache dir is clear
ed.
# Because
Windows don't use docker, the shared lib already exists in the
#
cache dir, it will not be compiled again unless the shared lib is remov
ed.
if
os
.
name
==
'nt'
:
cmd
=
'rmdir {} /s/q'
.
format
(
get_build_directory
())
else
:
cmd
=
'rm -rf {}'
.
format
(
get_build_directory
())
run_cmd
(
cmd
,
True
)
cmd
=
'del {}
\\
simple_jit_relu2.pyd'
.
format
(
get_build_directory
())
run_cmd
(
cmd
,
True
)
# Compile and load custom op Just-In-Time.
custom_module
=
load
(
name
=
'simple_jit_relu2'
,
sources
=
[
'relu_op_simple.cc'
,
'relu_op_simple.cu'
,
'relu_op3_simple.cc'
],
extra_include_paths
=
paddle_includes
,
# add for Coverage CI
extra_cflags
=
extra_compile_args
)
# add for Coverage CI
extra_cflags
=
extra_compile_args
,
# add for Coverage CI
verbose
=
True
)
class
TestJITLoad
(
unittest
.
TestCase
):
...
...
python/paddle/utils/cpp_extension/extension_utils.py
浏览文件 @
44ee251f
...
...
@@ -323,7 +323,6 @@ def find_cuda_home():
if
six
.
PY3
:
nvcc_path
=
nvcc_path
.
decode
()
nvcc_path
=
nvcc_path
.
rstrip
(
'
\r\n
'
)
log_v
(
nvcc_path
)
# for example: /usr/local/cuda/bin/nvcc
cuda_home
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
nvcc_path
))
except
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录