提交 fd5a0c52 编写于 作者: Z zhangjun

解决arm、gpu执行兼容性问题

上级 2c516c8d
...@@ -91,15 +91,27 @@ if (SERVER) ...@@ -91,15 +91,27 @@ if (SERVER)
DEPENDS ${SERVING_SERVER_CORE} server_config_py_proto ${PY_FILES}) DEPENDS ${SERVING_SERVER_CORE} server_config_py_proto ${PY_FILES})
add_custom_target(paddle_python ALL DEPENDS ${PADDLE_SERVING_BINARY_DIR}/.timestamp) add_custom_target(paddle_python ALL DEPENDS ${PADDLE_SERVING_BINARY_DIR}/.timestamp)
elseif(WITH_LITE) elseif(WITH_LITE)
add_custom_command( if(WITH_XPU)
OUTPUT ${PADDLE_SERVING_BINARY_DIR}/.timestamp add_custom_command(
COMMAND cp -r OUTPUT ${PADDLE_SERVING_BINARY_DIR}/.timestamp
${CMAKE_CURRENT_SOURCE_DIR}/paddle_serving_server_gpu/ ${PADDLE_SERVING_BINARY_DIR}/python/ COMMAND cp -r
COMMAND env ${py_env} ${PYTHON_EXECUTABLE} gen_version.py ${CMAKE_CURRENT_SOURCE_DIR}/paddle_serving_server_gpu/ ${PADDLE_SERVING_BINARY_DIR}/python/
"server_gpu" arm COMMAND env ${py_env} ${PYTHON_EXECUTABLE} gen_version.py
COMMAND env ${py_env} ${PYTHON_EXECUTABLE} setup.py bdist_wheel "server_gpu" arm-xpu
DEPENDS ${SERVING_SERVER_CORE} server_config_py_proto ${PY_FILES}) COMMAND env ${py_env} ${PYTHON_EXECUTABLE} setup.py bdist_wheel
add_custom_target(paddle_python ALL DEPENDS ${PADDLE_SERVING_BINARY_DIR}/.timestamp) DEPENDS ${SERVING_SERVER_CORE} server_config_py_proto ${PY_FILES})
add_custom_target(paddle_python ALL DEPENDS ${PADDLE_SERVING_BINARY_DIR}/.timestamp)
else()
add_custom_command(
OUTPUT ${PADDLE_SERVING_BINARY_DIR}/.timestamp
COMMAND cp -r
${CMAKE_CURRENT_SOURCE_DIR}/paddle_serving_server_gpu/ ${PADDLE_SERVING_BINARY_DIR}/python/
COMMAND env ${py_env} ${PYTHON_EXECUTABLE} gen_version.py
"server_gpu" arm
COMMAND env ${py_env} ${PYTHON_EXECUTABLE} setup.py bdist_wheel
DEPENDS ${SERVING_SERVER_CORE} server_config_py_proto ${PY_FILES})
add_custom_target(paddle_python ALL DEPENDS ${PADDLE_SERVING_BINARY_DIR}/.timestamp)
endif()
else() else()
add_custom_command( add_custom_command(
OUTPUT ${PADDLE_SERVING_BINARY_DIR}/.timestamp OUTPUT ${PADDLE_SERVING_BINARY_DIR}/.timestamp
......
...@@ -311,8 +311,9 @@ class Server(object): ...@@ -311,8 +311,9 @@ class Server(object):
engine.static_optimization = False engine.static_optimization = False
engine.force_update_static_cache = False engine.force_update_static_cache = False
engine.use_trt = self.use_trt engine.use_trt = self.use_trt
engine.use_lite = self.use_lite if device == "arm":
engine.use_xpu = self.use_xpu engine.use_lite = self.use_lite
engine.use_xpu = self.use_xpu
...@@ -425,7 +426,7 @@ class Server(object): ...@@ -425,7 +426,7 @@ class Server(object):
cuda_version = line.split("\"")[1] cuda_version = line.split("\"")[1]
if cuda_version == "trt": if cuda_version == "trt":
device_version = "serving-gpu-" + cuda_version + "-" device_version = "serving-gpu-" + cuda_version + "-"
elif cuda_version == "arm": elif cuda_version == "arm" or cuda_version == "arm-xpu":
device_version = "serving-" + cuda_version + "-" device_version = "serving-" + cuda_version + "-"
else: else:
device_version = "serving-gpu-cuda" + cuda_version + "-" device_version = "serving-gpu-cuda" + cuda_version + "-"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册