From e7f2bf37106b652a366ca123cbf73eda218d915b Mon Sep 17 00:00:00 2001 From: Zhang Zheng <32410583+ZzSean@users.noreply.github.com> Date: Wed, 12 Jan 2022 14:57:02 +0800 Subject: [PATCH] Add pten change file check for op benchmark (#38796) * Add pten change file check for op benchmark * fix style format * test * revert --- tools/ci_op_benchmark.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/ci_op_benchmark.sh b/tools/ci_op_benchmark.sh index 8d28b71a344..9872a3b1a33 100644 --- a/tools/ci_op_benchmark.sh +++ b/tools/ci_op_benchmark.sh @@ -43,6 +43,10 @@ function match_cu_file_directory { do [ "${cu_file_dir}" == "paddle/fluid/operators${sub_dir}" ] && return 0 done + for sub_dir in "" "/gpu" "/hybird" + do + [ "${cu_file_dir}" == "paddle/pten/kernels${sub_dir}" ] && return 0 + done return 1 } @@ -50,7 +54,7 @@ function match_cu_file_directory { function load_CHANGE_OP_FILES_by_header_file { LOG "[INFO] run function load_CHANGE_OP_FILES_by_header_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 if [[ "$change_file" =~ "_op.cu" ]] then @@ -76,7 +80,7 @@ function load_CHANGE_OP_FILES { for change_file in $(git diff --name-only develop) do # match directory limit - [[ "$change_file" =~ "paddle/fluid/operators/" ]] || continue + [[ "$change_file" =~ "paddle/fluid/operators/" ]] || [[ "$change_file" =~ "paddle/pten/kernels/" ]] || continue # match file name limit if [[ "$change_file" =~ "_op.cu" ]] then @@ -295,7 +299,6 @@ if [ -n "${approval_line}" ]; then exit 0 fi fi -set -x case $1 in run_op_benchmark) -- GitLab