From 849a8492199384edc2d10a0a6cb83e8d5b666cd1 Mon Sep 17 00:00:00 2001 From: wangguibao Date: Tue, 26 Feb 2019 17:14:27 +0800 Subject: [PATCH] Move mempool to predictor/mempool Change-Id: Idd9c5e4dc1c8e01bb55ea04e2a7b4a09c3999ea7 --- CMakeLists.txt | 1 - mempool/CMakeLists.txt | 2 -- predictor/CMakeLists.txt | 17 ++++++++--------- predictor/framework/memory.h | 2 +- predictor/mempool/CMakeLists.txt | 3 +++ {mempool => predictor/mempool}/mempool.cpp | 2 +- {mempool => predictor/mempool}/mempool.h | 0 7 files changed, 13 insertions(+), 14 deletions(-) delete mode 100644 mempool/CMakeLists.txt create mode 100644 predictor/mempool/CMakeLists.txt rename {mempool => predictor/mempool}/mempool.cpp (98%) rename {mempool => predictor/mempool}/mempool.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e6c4f21..9803a658 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,7 +97,6 @@ if(WITH_MKLDNN) endif() add_subdirectory(configure) -add_subdirectory(mempool) add_subdirectory(predictor) add_subdirectory(inferencer-fluid-cpu) add_subdirectory(serving) diff --git a/mempool/CMakeLists.txt b/mempool/CMakeLists.txt deleted file mode 100644 index 4e905ae6..00000000 --- a/mempool/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_library(mempool ${CMAKE_CURRENT_LIST_DIR}/mempool.cpp) -add_dependencies(mempool brpc) diff --git a/predictor/CMakeLists.txt b/predictor/CMakeLists.txt index 8a80e320..9e0a9ac1 100644 --- a/predictor/CMakeLists.txt +++ b/predictor/CMakeLists.txt @@ -1,6 +1,7 @@ include(proto/CMakeLists.txt) include(common/CMakeLists.txt) include(op/CMakeLists.txt) +include(mempool/CMakeLists.txt) include(framework/CMakeLists.txt) include(plugin/CMakeLists.txt) include(src/CMakeLists.txt) @@ -16,18 +17,16 @@ set_source_files_properties( ${pdserving_srcs} PROPERTIES COMPILE_FLAGS "-Wno-strict-aliasing -Wno-unused-variable -Wno-non-virtual-dtor -Wno-error=non-virtual-dtor -Wno-error=delete-non-virtual-dtor") -add_dependencies(pdserving protobuf boost brpc leveldb pdcodegen - configure mempool) +add_dependencies(pdserving protobuf boost brpc leveldb pdcodegen configure) target_include_directories(pdserving PUBLIC ${CMAKE_CURRENT_LIST_DIR}/ ${CMAKE_CURRENT_BINARY_DIR}/ ${CMAKE_CURRENT_BINARY_DIR}/../configure ${CMAKE_CURRENT_LIST_DIR}/../configure/include - ${CMAKE_CURRENT_LIST_DIR}/../mempool) + ) target_link_libraries(pdserving - brpc protobuf boost leveldb configure - mempool -lpthread -lcrypto -lm -lrt -lssl -ldl -lz) + brpc protobuf boost leveldb configure -lpthread -lcrypto -lm -lrt -lssl -ldl -lz) add_executable(pdserving_exe ${pdserving_srcs}) set_source_files_properties( @@ -35,16 +34,16 @@ set_source_files_properties( PROPERTIES COMPILE_FLAGS "-Wno-strict-aliasing -Wno-unused-variable -Wno-non-virtual-dtor -Wno-error=non-virtual-dtor -Wno-error=delete-non-virtual-dtor") add_dependencies(pdserving_exe - protobuf boost brpc leveldb pdcodegen configure mempool) + protobuf boost brpc leveldb pdcodegen configure) target_include_directories(pdserving_exe PUBLIC ${CMAKE_CURRENT_LIST_DIR}/ ${CMAKE_CURRENT_BINARY_DIR}/ ${CMAKE_CURRENT_BINARY_DIR}/../configure ${CMAKE_CURRENT_LIST_DIR}/../configure/include - ${CMAKE_CURRENT_LIST_DIR}/../mempool) + ) target_link_libraries(pdserving_exe brpc protobuf leveldb - configure mempool -lpthread -lcrypto -lm -lrt -lssl + configure -lpthread -lcrypto -lm -lrt -lssl -ldl -lz) add_library(pdclient ${pdclient_srcs}) @@ -59,6 +58,6 @@ target_include_directories(pdclient PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/ ${CMAKE_CURRENT_BINARY_DIR}/../configure ${CMAKE_CURRENT_LIST_DIR}/../configure/include - ${CMAKE_CURRENT_LIST_DIR}/../mempool) + ) target_link_libraries(pdclient protobuf boost brpc -lpthread -lcrypto -lm -lrt -lssl -ldl -lz) diff --git a/predictor/framework/memory.h b/predictor/framework/memory.h index f9f68035..cc7e40b4 100644 --- a/predictor/framework/memory.h +++ b/predictor/framework/memory.h @@ -2,7 +2,7 @@ #define BAIDU_PADDLE_SERVING_PREDICTOR_MEMORY_H #include "common/inner_common.h" -#include "mempool.h" +#include "mempool/mempool.h" namespace baidu { namespace paddle_serving { diff --git a/predictor/mempool/CMakeLists.txt b/predictor/mempool/CMakeLists.txt new file mode 100644 index 00000000..041931df --- /dev/null +++ b/predictor/mempool/CMakeLists.txt @@ -0,0 +1,3 @@ +FILE(GLOB mempool_srcs ${CMAKE_CURRENT_LIST_DIR}/*.cpp) +LIST(APPEND pdserving_srcs ${mempool_srcs}) +LIST(APPEND pdclient_srcs ${mempool_srcs}) diff --git a/mempool/mempool.cpp b/predictor/mempool/mempool.cpp similarity index 98% rename from mempool/mempool.cpp rename to predictor/mempool/mempool.cpp index ba4a536a..11b2f3dd 100644 --- a/mempool/mempool.cpp +++ b/predictor/mempool/mempool.cpp @@ -1,4 +1,4 @@ -#include "mempool.h" +#include "mempool/mempool.h" namespace im { diff --git a/mempool/mempool.h b/predictor/mempool/mempool.h similarity index 100% rename from mempool/mempool.h rename to predictor/mempool/mempool.h -- GitLab