diff --git a/paddle/fluid/inference/api/demo_ci/vis_demo.cc b/paddle/fluid/inference/api/demo_ci/vis_demo.cc index 5320992b7e78f4aa0ea8950af03038c1953dd027..2c6093fa487b46c0e772aefb832e02b3594156b9 100644 --- a/paddle/fluid/inference/api/demo_ci/vis_demo.cc +++ b/paddle/fluid/inference/api/demo_ci/vis_demo.cc @@ -82,10 +82,12 @@ void Main(bool use_gpu) { int main(int argc, char** argv) { google::ParseCommandLineFlags(&argc, &argv, true); +#if CUDNN_VERSION >= 7100 if (FLAGS_use_gpu) { paddle::demo::Main(true /*use_gpu*/); } else { paddle::demo::Main(false /*use_gpu*/); } +#endif return 0; } diff --git a/paddle/fluid/inference/tests/api/CMakeLists.txt b/paddle/fluid/inference/tests/api/CMakeLists.txt index 423c39813f05af0d6aaade184914e6777c9b8a83..cb4af28dc96d4d58b7237f5db7e8364838055230 100644 --- a/paddle/fluid/inference/tests/api/CMakeLists.txt +++ b/paddle/fluid/inference/tests/api/CMakeLists.txt @@ -144,7 +144,8 @@ if (WITH_ANAKIN AND WITH_MKL) # only needed in CI endif() endif() -if(WITH_GPU AND TENSORRT_FOUND) +if (NOT ${CUDNN_VERSION} VERSION_LESS 7100) + if(WITH_GPU AND TENSORRT_FOUND) set(TRT_MODEL_INSTALL_DIR "${INFERENCE_DEMO_INSTALL_DIR}/trt") if (NOT EXISTS ${TRT_MODEL_INSTALL_DIR}) inference_download_and_uncompress(${TRT_MODEL_INSTALL_DIR} ${INFERENCE_URL}/tensorrt_test "trt_test_models.tar.gz") @@ -152,4 +153,5 @@ if(WITH_GPU AND TENSORRT_FOUND) inference_analysis_test(test_trt_models SRCS trt_models_tester.cc EXTRA_DEPS ${INFERENCE_EXTRA_DEPS} ARGS --infer_model=${TRT_MODEL_INSTALL_DIR}/trt_test_models SERIAL) + endif() endif()