未验证 提交 8f7bb52b 编写于 作者: S Shibo Tao 提交者: GitHub

fix tensorrt 6 build error. test=develop (#27511)

* fix tensorrt 6 build error. test=develop

* fix. test=develop

* bug fix

* test=develop
上级 081fb2f9
...@@ -35,7 +35,7 @@ extern void* tensorrt_dso_handle; ...@@ -35,7 +35,7 @@ extern void* tensorrt_dso_handle;
#define DECLARE_DYNAMIC_LOAD_TENSORRT_WRAP(__name) \ #define DECLARE_DYNAMIC_LOAD_TENSORRT_WRAP(__name) \
struct DynLoad__##__name { \ struct DynLoad__##__name { \
template <typename... Args> \ template <typename... Args> \
auto operator()(Args... args) -> DECLARE_TYPE(__name, args...) { \ void* operator()(Args... args) { \
std::call_once(tensorrt_dso_flag, []() { \ std::call_once(tensorrt_dso_flag, []() { \
tensorrt_dso_handle = paddle::platform::dynload::GetTensorRtHandle(); \ tensorrt_dso_handle = paddle::platform::dynload::GetTensorRtHandle(); \
}); \ }); \
...@@ -44,7 +44,8 @@ extern void* tensorrt_dso_handle; ...@@ -44,7 +44,8 @@ extern void* tensorrt_dso_handle;
return nullptr; \ return nullptr; \
} \ } \
using tensorrt_func = decltype(&::__name); \ using tensorrt_func = decltype(&::__name); \
return reinterpret_cast<tensorrt_func>(p_##__name)(args...); \ auto ret = reinterpret_cast<tensorrt_func>(p_##__name)(args...); \
return static_cast<void*>(ret); \
} \ } \
}; \ }; \
extern DynLoad__##__name __name extern DynLoad__##__name __name
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册