From 484b3bc80189824b4d3deb3af94273838a6c7480 Mon Sep 17 00:00:00 2001 From: nhzlx Date: Thu, 24 Jan 2019 03:53:32 +0000 Subject: [PATCH] When cudnn version < 7100, there is problem with conv_fusion. Add check for it. test=develop --- paddle/fluid/inference/api/demo_ci/vis_demo.cc | 2 ++ paddle/fluid/inference/tests/api/CMakeLists.txt | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/inference/api/demo_ci/vis_demo.cc b/paddle/fluid/inference/api/demo_ci/vis_demo.cc index 5320992b7e7..2c6093fa487 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 423c39813f0..cb4af28dc96 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() -- GitLab