From f82baed86678645eb4e9989fd72fcc10fd0c4dc9 Mon Sep 17 00:00:00 2001 From: Pei Yang Date: Tue, 28 Jul 2020 13:00:58 +0800 Subject: [PATCH] fix trt instance norm plugin on gcc8. test=develop (#25730) --- .../inference/tensorrt/plugin/instance_norm_op_plugin.cu | 1 + paddle/fluid/inference/tests/api/CMakeLists.txt | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/paddle/fluid/inference/tensorrt/plugin/instance_norm_op_plugin.cu b/paddle/fluid/inference/tensorrt/plugin/instance_norm_op_plugin.cu index 835dc4ac30e..a22714aa92f 100644 --- a/paddle/fluid/inference/tensorrt/plugin/instance_norm_op_plugin.cu +++ b/paddle/fluid/inference/tensorrt/plugin/instance_norm_op_plugin.cu @@ -111,6 +111,7 @@ int InstanceNormPlugin::enqueue(int batch_size, const void *const *inputs, handle_, CUDNN_BATCHNORM_SPATIAL_PERSISTENT, &alpha, &beta, x_desc_, x_ptr, y_desc_, y_ptr, b_desc_, scale_d, bias_d, 1., nullptr, nullptr, eps_, nullptr, nullptr); + return cudaGetLastError() != cudaSuccess; } } // namespace plugin diff --git a/paddle/fluid/inference/tests/api/CMakeLists.txt b/paddle/fluid/inference/tests/api/CMakeLists.txt index 22bf27ce594..0125011b74a 100644 --- a/paddle/fluid/inference/tests/api/CMakeLists.txt +++ b/paddle/fluid/inference/tests/api/CMakeLists.txt @@ -389,10 +389,9 @@ if(WITH_GPU AND TENSORRT_FOUND) inference_analysis_test(trt_split_converter_test SRCS trt_split_converter_test.cc EXTRA_DEPS ${INFERENCE_EXTRA_DEPS} ARGS --infer_model=${TEST_SPLIT_CONVERTER_MODEL}/) - #TODO(peiyang): Fix this unitest failed on GCC8. - #inference_analysis_test(trt_instance_norm_test SRCS trt_instance_norm_converter_test.cc - # EXTRA_DEPS ${INFERENCE_EXTRA_DEPS} - # ARGS --infer_model=${TEST_INSTANCE_NORM_MODEL}/) + inference_analysis_test(trt_instance_norm_test SRCS trt_instance_norm_converter_test.cc + EXTRA_DEPS ${INFERENCE_EXTRA_DEPS} + ARGS --infer_model=${TEST_INSTANCE_NORM_MODEL}/) inference_analysis_test(test_analyzer_capi_gpu SRCS analyzer_capi_gpu_tester.cc EXTRA_DEPS ${INFERENCE_EXTRA_DEPS} paddle_fluid_c ARGS --infer_model=${TRT_MODEL_INSTALL_DIR}/trt_inference_test_models) -- GitLab