未验证 提交 6e823cfe 编写于 作者: W wanghuancoder 提交者: GitHub

add op_function_generator.exe retry in windows, test=develop (#26591)

add op_function_generator.exe retry in windows
上级 fa08a834
......@@ -72,8 +72,23 @@ if(WITH_PYTHON)
set(tmp_impl_file ${impl_file}.tmp)
if(WIN32)
file(WRITE ${CMAKE_BINARY_DIR}/paddle/fluid/pybind/op_function_generator_retry.bat ""
"set build_times=1\n"
":retry\n"
"ECHO op_function_generator run %build_times% time\n"
"${CMAKE_BINARY_DIR}/paddle/fluid/pybind/${CMAKE_BUILD_TYPE}/op_function_generator ${impl_file}\n"
"if %ERRORLEVEL% NEQ 0 (\n"
" set /a build_times=%build_times%+1\n"
" if %build_times% GTR 100 (\n"
" exit /b 1\n"
" ) else (\n"
" goto :retry\n"
" )\n"
")\n"
"exit /b 0")
add_custom_command(TARGET op_function_generator POST_BUILD
COMMAND ${CMAKE_BINARY_DIR}/paddle/fluid/pybind/${CMAKE_BUILD_TYPE}/op_function_generator ${impl_file}
COMMAND ${CMAKE_BINARY_DIR}/paddle/fluid/pybind/op_function_generator_retry.bat
)
if(${CBLAS_PROVIDER} STREQUAL MKLML)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册