diff --git a/cmake/flags.cmake b/cmake/flags.cmake index 8b8af0374403ba11915051b05af047bbc38c3cb6..6e18249b1a5595e31d1f423d8246478650f49606 100644 --- a/cmake/flags.cmake +++ b/cmake/flags.cmake @@ -257,7 +257,9 @@ if(WITH_ROCM) string(REPLACE "-Werror" "-Wno-error" CMAKE_C_FLAGS ${CMAKE_C_FLAGS}) endif() -if(WITH_PSCORE OR WITH_PSLIB) +if(WITH_PSCORE + OR WITH_PSLIB + OR WITH_TENSORRT) string(REPLACE "-Wnon-virtual-dtor" "-Wno-non-virtual-dtor" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) string(REPLACE "-Wnon-virtual-dtor" "-Wno-non-virtual-dtor" CMAKE_C_FLAGS diff --git a/paddle/fluid/inference/tensorrt/plugin/common/bertCommon.h b/paddle/fluid/inference/tensorrt/plugin/common/bertCommon.h index 56d4edd67936b3d656e6a137c5e1af7b555c82f5..c3bdc34100478f4f14ef665b53b0b260e13ce47a 100644 --- a/paddle/fluid/inference/tensorrt/plugin/common/bertCommon.h +++ b/paddle/fluid/inference/tensorrt/plugin/common/bertCommon.h @@ -82,8 +82,9 @@ inline uint32_t getElementSize(nvinfer1::DataType t) noexcept { case nvinfer1::DataType::kBOOL: case nvinfer1::DataType::kINT8: return 1; + default: + return 0; } - return 0; } inline int64_t getWeightsSize(const nvinfer1::Weights& w,