forked from cupy/cupy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclean_cpp_so_files.sh
More file actions
24 lines (20 loc) · 858 Bytes
/
clean_cpp_so_files.sh
File metadata and controls
24 lines (20 loc) · 858 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# 获取脚本所在目录的绝对路径
SCRIPT_DIR=$(cd "$(dirname "$(readlink -f "$0")")" && pwd)
echo "script folder path: $SCRIPT_DIR"
# 尝试列出配置目录(如果存在)
if [ -d "${SCRIPT_DIR}/cupy/_core" ]; then
ls -l "${SCRIPT_DIR}"
else
echo "Warning: this script is not root folder of numpy-ascend/cupy repo, skip cleaning files"
exit -1
fi
# clean up so file ,to switch backend
NUMPY_ASCEND_DIR=${SCRIPT_DIR}
set -x
cd ${NUMPY_ASCEND_DIR}/cupy/_core && rm *.cpp && rm *.so
cd ${NUMPY_ASCEND_DIR}/cupy/xpu && rm *.cpp && rm *.so
cd ${NUMPY_ASCEND_DIR}/cupy/backends/backend/api && rm *.cpp && rm *.so
cd ${NUMPY_ASCEND_DIR}/cupy/backends/backend && rm *.cpp && rm *.so
cd ${NUMPY_ASCEND_DIR}/cupy/backends/ascend/api && rm *.cpp && rm *.so
cd ${NUMPY_ASCEND_DIR}
echo "Sucessfully clean cython generated cpp and so files"