add compile option WITH_TENSORRT (#29208)

* add compile option WITH_TENSORRT

* add WITH_TENSORRT to ci paddle_buils.sh

* add WITH_TENSORRT to paddle_build.sh

* change FATAL to WARNING when TensorRT is not found and WITN_TENSORRT=ON, just to pass ci-py3 temporarily
revert-31562-mean
Shang Zhizhou 5 years ago committed by GitHub
parent 116305ea4b
commit fc80d2e09c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -28,6 +28,7 @@ include(generic) # simplify cmake module
# TODO(Shibo Tao): remove find_package(CUDA) completely.
find_package(CUDA QUIET)
option(WITH_GPU "Compile PaddlePaddle with NVIDIA GPU" ${CUDA_FOUND})
option(WITH_TENSORRT "Compile PaddlePaddle with NVIDIA TensorRT" OFF)
option(WITH_XPU "Compile PaddlePaddle with BAIDU KUNLUN" OFF)
if (WITH_GPU AND WITH_XPU)
message(FATAL_ERROR "Error when compile GPU and XPU at the same time")

@ -1,4 +1,4 @@
if(NOT WITH_GPU)
if(NOT WITH_GPU OR NOT WITH_TENSORRT)
return()
endif()
@ -40,7 +40,7 @@ if(TENSORRT_INCLUDE_DIR AND TENSORRT_LIBRARY)
set(TENSORRT_FOUND ON)
else()
set(TENSORRT_FOUND OFF)
message(STATUS "TensorRT is disabled.")
message(WARNING "TensorRT is disabled. You are compiling PaddlePaddle with option -DWITH_TENSORRT=ON, but TensorRT is not found, please configure path to TensorRT with option -DTENSORRT_ROOT or install it.")
endif()
if(TENSORRT_FOUND)

@ -222,6 +222,7 @@ function cmake_base() {
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-Release}
${PYTHON_FLAGS}
-DWITH_GPU=${WITH_GPU:-OFF}
-DWITH_TENSORRT=${WITH_TENSORRT:-ON}
-DWITH_AMD_GPU=${WITH_AMD_GPU:-OFF}
-DWITH_DISTRIBUTE=${distibuted_flag}
-DWITH_MKL=${WITH_MKL:-ON}
@ -254,6 +255,7 @@ EOF
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-Release} \
${PYTHON_FLAGS} \
-DWITH_GPU=${WITH_GPU:-OFF} \
-DWITH_TENSORRT=${WITH_TENSORRT:-ON} \
-DWITH_AMD_GPU=${WITH_AMD_GPU:-OFF} \
-DWITH_DISTRIBUTE=${distibuted_flag} \
-DWITH_MKL=${WITH_MKL:-ON} \

Loading…
Cancel
Save