未验证 提交 e7f2bf37 编写于 作者: Z Zhang Zheng 提交者: GitHub

Add pten change file check for op benchmark (#38796)

* Add pten change file check for op benchmark

* fix style format

* test

* revert
上级 676903d5
...@@ -43,6 +43,10 @@ function match_cu_file_directory { ...@@ -43,6 +43,10 @@ function match_cu_file_directory {
do do
[ "${cu_file_dir}" == "paddle/fluid/operators${sub_dir}" ] && return 0 [ "${cu_file_dir}" == "paddle/fluid/operators${sub_dir}" ] && return 0
done done
for sub_dir in "" "/gpu" "/hybird"
do
[ "${cu_file_dir}" == "paddle/pten/kernels${sub_dir}" ] && return 0
done
return 1 return 1
} }
...@@ -50,7 +54,7 @@ function match_cu_file_directory { ...@@ -50,7 +54,7 @@ function match_cu_file_directory {
function load_CHANGE_OP_FILES_by_header_file { function load_CHANGE_OP_FILES_by_header_file {
LOG "[INFO] run function load_CHANGE_OP_FILES_by_header_file" LOG "[INFO] run function load_CHANGE_OP_FILES_by_header_file"
local change_file local change_file
for change_file in $(grep -rl "${1}" paddle/fluid/operators) for change_file in $(grep -rl "${1}" paddle/fluid/operators paddle/pten/kernels/)
do do
if [[ "$change_file" =~ "_op.cu" ]] if [[ "$change_file" =~ "_op.cu" ]]
then then
...@@ -76,7 +80,7 @@ function load_CHANGE_OP_FILES { ...@@ -76,7 +80,7 @@ function load_CHANGE_OP_FILES {
for change_file in $(git diff --name-only develop) for change_file in $(git diff --name-only develop)
do do
# match directory limit # match directory limit
[[ "$change_file" =~ "paddle/fluid/operators/" ]] || continue [[ "$change_file" =~ "paddle/fluid/operators/" ]] || [[ "$change_file" =~ "paddle/pten/kernels/" ]] || continue
# match file name limit # match file name limit
if [[ "$change_file" =~ "_op.cu" ]] if [[ "$change_file" =~ "_op.cu" ]]
then then
...@@ -295,7 +299,6 @@ if [ -n "${approval_line}" ]; then ...@@ -295,7 +299,6 @@ if [ -n "${approval_line}" ]; then
exit 0 exit 0
fi fi
fi fi
set -x
case $1 in case $1 in
run_op_benchmark) run_op_benchmark)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册