提交 4d6aca4b 编写于 作者: L liaogang

Warpctc only support dynamic load

上级 425f9515
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
INCLUDE(cblas) INCLUDE(cblas)
IF(NOT ${CBLAS_FOUND}) IF(NOT ${CBLAS_FOUND})
MESSAGE(FATAL_ERROR "Please install OpenBlas, MKL or ATLAS.")
INCLUDE(ExternalProject) INCLUDE(ExternalProject)
SET(CBLAS_SOURCES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/openblas) SET(CBLAS_SOURCES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/openblas)
......
...@@ -121,10 +121,6 @@ function(link_paddle_exe TARGET_NAME) ...@@ -121,10 +121,6 @@ function(link_paddle_exe TARGET_NAME)
endif() endif()
endif() endif()
if(NOT WITH_DSO)
target_link_libraries(${TARGET_NAME} ${WARPCTC_LIBRARIES})
endif()
add_dependencies(${TARGET_NAME} ${external_project_dependencies}) add_dependencies(${TARGET_NAME} ${external_project_dependencies})
endfunction() endfunction()
......
...@@ -29,7 +29,6 @@ void* warpctc_dso_handle = nullptr; ...@@ -29,7 +29,6 @@ void* warpctc_dso_handle = nullptr;
* false, you need to add the path of libwarp-ctc.so to * false, you need to add the path of libwarp-ctc.so to
* the linked-libs of paddle or to LD_PRELOAD. * the linked-libs of paddle or to LD_PRELOAD.
*/ */
#ifdef PADDLE_USE_DSO
#define DYNAMIC_LOAD_WARPCTC_WRAP(__name) \ #define DYNAMIC_LOAD_WARPCTC_WRAP(__name) \
struct DynLoad__##__name { \ struct DynLoad__##__name { \
template <typename... Args> \ template <typename... Args> \
...@@ -41,15 +40,6 @@ void* warpctc_dso_handle = nullptr; ...@@ -41,15 +40,6 @@ void* warpctc_dso_handle = nullptr;
return reinterpret_cast<warpctcFunc>(p_##_name)(args...); \ return reinterpret_cast<warpctcFunc>(p_##_name)(args...); \
} \ } \
} __name; // struct DynLoad__##__name } __name; // struct DynLoad__##__name
#else
#define DYNAMIC_LOAD_WARPCTC_WRAP(__name) \
struct DynLoad__##__name { \
template <typename... Args> \
auto operator()(Args... args) -> decltype(__name(args...)) { \
return __name(args...); \
} \
} __name; // struct DynLoad__##__name
#endif
// include all needed warp-ctc functions // include all needed warp-ctc functions
DYNAMIC_LOAD_WARPCTC_WRAP(get_warpctc_version) DYNAMIC_LOAD_WARPCTC_WRAP(get_warpctc_version)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册