From 8f7bb52bd2e0cdf23c3441f3ec85b733a0f900f0 Mon Sep 17 00:00:00 2001 From: Shibo Tao <62922815+T8T9@users.noreply.github.com> Date: Thu, 24 Sep 2020 13:52:48 +0800 Subject: [PATCH] fix tensorrt 6 build error. test=develop (#27511) * fix tensorrt 6 build error. test=develop * fix. test=develop * bug fix * test=develop --- paddle/fluid/platform/dynload/tensorrt.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/platform/dynload/tensorrt.h b/paddle/fluid/platform/dynload/tensorrt.h index 67a79ce4bb1..cb751071062 100644 --- a/paddle/fluid/platform/dynload/tensorrt.h +++ b/paddle/fluid/platform/dynload/tensorrt.h @@ -35,7 +35,7 @@ extern void* tensorrt_dso_handle; #define DECLARE_DYNAMIC_LOAD_TENSORRT_WRAP(__name) \ struct DynLoad__##__name { \ template \ - auto operator()(Args... args) -> DECLARE_TYPE(__name, args...) { \ + void* operator()(Args... args) { \ std::call_once(tensorrt_dso_flag, []() { \ tensorrt_dso_handle = paddle::platform::dynload::GetTensorRtHandle(); \ }); \ @@ -44,7 +44,8 @@ extern void* tensorrt_dso_handle; return nullptr; \ } \ using tensorrt_func = decltype(&::__name); \ - return reinterpret_cast(p_##__name)(args...); \ + auto ret = reinterpret_cast(p_##__name)(args...); \ + return static_cast(ret); \ } \ }; \ extern DynLoad__##__name __name -- GitLab