提交 28f2ed43 编写于 作者: P peng.xu

Merge branch 'branch-0.5.0' into 'branch-0.5.0'

MS-600 Reconstruct unittest code

See merge request megasearch/milvus!645

Former-commit-id: 9b72cac2591f4e3307e3b7e25eb25319677496f9
......@@ -33,6 +33,7 @@ Please mark all change in change log and use the ticket from JIRA.
- MS-575 - Add Clang-format & Clang-tidy & Cpplint
- MS-586 - Remove BUILD_FAISS_WITH_MKL option
- MS-590 - Refine cmake code to support cpplint
- MS-600 - Reconstruct unittest code
# Milvus 0.4.0 (2019-09-12)
......
......@@ -20,29 +20,24 @@
include_directories(${MILVUS_SOURCE_DIR})
include_directories(${MILVUS_ENGINE_SRC})
add_subdirectory(core)
include_directories(${CUDA_TOOLKIT_ROOT_DIR}/include)
include_directories(${MILVUS_ENGINE_SRC}/grpc/gen-status)
include_directories(${MILVUS_ENGINE_SRC}/grpc/gen-milvus)
#this statement must put here, since the CORE_INCLUDE_DIRS is defined in code/CMakeList.txt
add_subdirectory(core)
set(CORE_INCLUDE_DIRS ${CORE_INCLUDE_DIRS} PARENT_SCOPE)
foreach (dir ${CORE_INCLUDE_DIRS})
include_directories(${dir})
endforeach ()
aux_source_directory(${MILVUS_ENGINE_SRC}/cache cache_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/config config_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/metrics metrics_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/db db_main_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/db/engine db_engine_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/db/insert db_insert_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/db/meta db_meta_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/db/scheduler db_scheduler_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/db/scheduler/context db_scheduler_context_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/db/scheduler/task db_scheduler_task_files)
set(db_scheduler_files
${db_scheduler_files}
${db_scheduler_context_files}
${db_scheduler_task_files}
)
set(grpc_service_files
${MILVUS_ENGINE_SRC}/grpc/gen-milvus/milvus.grpc.pb.cc
......@@ -51,8 +46,6 @@ set(grpc_service_files
${MILVUS_ENGINE_SRC}/grpc/gen-status/status.pb.cc
)
aux_source_directory(${MILVUS_ENGINE_SRC}/metrics metrics_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/scheduler scheduler_main_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/scheduler/action scheduler_action_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/scheduler/event scheduler_event_files)
......@@ -70,9 +63,7 @@ set(scheduler_files
aux_source_directory(${MILVUS_ENGINE_SRC}/server server_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/server/grpc_impl grpc_server_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/utils utils_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/wrapper wrapper_files)
set(engine_files
......@@ -82,16 +73,11 @@ set(engine_files
${db_engine_files}
${db_insert_files}
${db_meta_files}
${db_scheduler_files}
${metrics_files}
${utils_files}
${wrapper_files}
)
include_directories("${CUDA_TOOLKIT_ROOT_DIR}/include")
include_directories(${MILVUS_ENGINE_SRC}/grpc/gen-status)
include_directories(${MILVUS_ENGINE_SRC}/grpc/gen-milvus)
set(client_grpc_lib
grpcpp_channelz
grpc++
......@@ -112,6 +98,12 @@ set(boost_lib
boost_serialization_static
)
set(cuda_lib
${CUDA_TOOLKIT_ROOT_DIR}/lib64/stubs/libnvidia-ml.so
cudart
cublas
)
set(third_party_libs
sqlite
${client_grpc_lib}
......@@ -123,12 +115,10 @@ set(third_party_libs
snappy
zlib
zstd
cudart
cublas
${cuda_lib}
mysqlpp
${CUDA_TOOLKIT_ROOT_DIR}/lib64/stubs/libnvidia-ml.so
cudart
)
if (MILVUS_ENABLE_PROFILING STREQUAL "ON")
set(third_party_libs ${third_party_libs}
gperftools
......@@ -141,7 +131,6 @@ set(engine_libs
pthread
libgomp.a
libgfortran.a
${CUDA_TOOLKIT_ROOT_DIR}/lib64/stubs/libnvidia-ml.so
)
if (NOT ${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64")
......@@ -152,7 +141,11 @@ if (NOT ${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64")
endif ()
cuda_add_library(milvus_engine STATIC ${engine_files})
target_link_libraries(milvus_engine ${engine_libs} knowhere ${third_party_libs})
target_link_libraries(milvus_engine
knowhere
${engine_libs}
${third_party_libs}
)
add_library(metrics STATIC ${metrics_files})
......@@ -180,7 +173,9 @@ add_executable(milvus_server
${utils_files}
)
target_link_libraries(milvus_server ${server_libs})
target_link_libraries(milvus_server
${server_libs}
)
install(TARGETS milvus_server DESTINATION bin)
......
......@@ -17,11 +17,9 @@
# under the License.
#-------------------------------------------------------------------------------
aux_source_directory(interface interface_files)
include_directories(include)
aux_source_directory(interface interface_files)
aux_source_directory(grpc grpc_client_files)
add_library(milvus_sdk STATIC
......
......@@ -17,7 +17,6 @@
#include "sdk/examples/grpcsimple/src/ClientTest.h"
#include "MilvusApi.h"
#include "cache/CpuCacheMgr.h"
#include <time.h>
#include <unistd.h>
......
......@@ -17,25 +17,25 @@
# under the License.
#-------------------------------------------------------------------------------
include_directories("${CUDA_TOOLKIT_ROOT_DIR}/include")
foreach(dir ${CORE_INCLUDE_DIRS})
include_directories(${dir})
endforeach()
include_directories(${MILVUS_SOURCE_DIR})
include_directories(${MILVUS_ENGINE_SRC})
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
aux_source_directory(${MILVUS_ENGINE_SRC}/cache cache_files)
link_directories("${CUDA_TOOLKIT_ROOT_DIR}/lib64")
aux_source_directory(${MILVUS_ENGINE_SRC}/cache cache_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/config config_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/metrics metrics_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/db db_main_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/db/engine db_engine_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/db/insert db_insert_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/db/meta db_meta_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/db/scheduler db_scheduler_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/db/scheduler/context db_scheduler_context_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/db/scheduler/task db_scheduler_task_files)
set(db_scheduler_files
${db_scheduler_files}
${db_scheduler_context_files}
${db_scheduler_task_files}
)
set(grpc_service_files
${MILVUS_ENGINE_SRC}/grpc/gen-milvus/milvus.grpc.pb.cc
......@@ -44,8 +44,6 @@ set(grpc_service_files
${MILVUS_ENGINE_SRC}/grpc/gen-status/status.pb.cc
)
aux_source_directory(${MILVUS_ENGINE_SRC}/metrics metrics_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/scheduler scheduler_main_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/scheduler/action scheduler_action_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/scheduler/event scheduler_event_files)
......@@ -63,12 +61,10 @@ set(scheduler_files
aux_source_directory(${MILVUS_ENGINE_SRC}/server server_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/server/grpc_impl grpc_server_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/utils utils_files)
aux_source_directory(${MILVUS_ENGINE_SRC}/wrapper wrapper_files)
set(unittest_files
set(entry_file
${CMAKE_CURRENT_SOURCE_DIR}/main.cpp)
set(helper_files
......@@ -87,7 +83,6 @@ set(common_files
${db_engine_files}
${db_insert_files}
${db_meta_files}
${db_scheduler_files}
${metrics_files}
${scheduler_files}
${wrapper_files}
......@@ -118,12 +113,6 @@ set(unittest_libs
cublas
)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
message(STATUS "CMAKE_CURRENT_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}")
foreach(dir ${CORE_INCLUDE_DIRS})
include_directories(${dir})
endforeach()
add_subdirectory(db)
add_subdirectory(wrapper)
add_subdirectory(metrics)
......
......@@ -20,18 +20,14 @@
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR} test_files)
include_directories("${CUDA_TOOLKIT_ROOT_DIR}/include")
link_directories("${CUDA_TOOLKIT_ROOT_DIR}/lib64")
set(db_test_files
cuda_add_executable(test_db
${common_files}
${test_files}
)
cuda_add_executable(db_test ${db_test_files})
target_link_libraries(db_test knowhere ${unittest_libs})
target_link_libraries(test_db
knowhere
${unittest_libs})
install(TARGETS db_test DESTINATION unittest)
install(TARGETS test_db DESTINATION unittest)
......@@ -19,16 +19,13 @@
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR} test_files)
include_directories("${CUDA_TOOLKIT_ROOT_DIR}/include")
link_directories("${CUDA_TOOLKIT_ROOT_DIR}/lib64")
set(metrics_test_files
add_executable(test_metrics
${common_files}
${test_files}
)
add_executable(metrics_test ${metrics_test_files})
target_link_libraries(metrics_test knowhere ${unittest_libs})
target_link_libraries(test_metrics
knowhere
${unittest_libs})
install(TARGETS metrics_test DESTINATION unittest)
\ No newline at end of file
install(TARGETS test_metrics DESTINATION unittest)
\ No newline at end of file
......@@ -19,18 +19,15 @@
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR} test_files)
include_directories("${CUDA_TOOLKIT_ROOT_DIR}/include")
link_directories("${CUDA_TOOLKIT_ROOT_DIR}/lib64")
set(scheduler_test_files
cuda_add_executable(test_scheduler
${common_files}
${unittest_files}
${entry_file}
${test_files}
)
cuda_add_executable(scheduler_test ${scheduler_test_files})
target_link_libraries(scheduler_test knowhere ${unittest_libs})
target_link_libraries(test_scheduler
knowhere
${unittest_libs})
install(TARGETS scheduler_test DESTINATION unittest)
install(TARGETS test_scheduler DESTINATION unittest)
......@@ -43,11 +43,11 @@ set(server_test_files
${grpc_server_files}
${grpc_service_files}
${util_files}
${unittest_files}
${entry_file}
${test_files}
)
cuda_add_executable(server_test ${server_test_files})
cuda_add_executable(test_server ${server_test_files})
set(client_grpc_lib
grpcpp_channelz
......@@ -56,7 +56,7 @@ set(client_grpc_lib
grpc_protobuf
grpc_protoc)
target_link_libraries(server_test
target_link_libraries(test_server
knowhere
stdc++
snappy
......@@ -66,7 +66,7 @@ target_link_libraries(server_test
${unittest_libs}
)
install(TARGETS server_test DESTINATION unittest)
install(TARGETS test_server DESTINATION unittest)
configure_file(appendix/server_config.yaml
"${CMAKE_CURRENT_BINARY_DIR}/milvus/conf/server_config.yaml"
......
......@@ -17,8 +17,7 @@
# under the License.
#-------------------------------------------------------------------------------
include_directories("${CUDA_TOOLKIT_ROOT_DIR}/include")
link_directories("${CUDA_TOOLKIT_ROOT_DIR}/lib64")
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR} test_files)
set(wrapper_files
${MILVUS_ENGINE_SRC}/wrapper/DataTransfer.cpp
......@@ -31,13 +30,13 @@ set(util_files
${MILVUS_ENGINE_SRC}/utils/Status.cpp
)
set(knowhere_libs
knowhere
cudart
cublas
)
add_executable(test_wrapper
${test_files}
${wrapper_files}
${util_files})
add_executable(wrapper_test wrapper_test.cpp ${wrapper_files} ${util_files})
target_link_libraries(wrapper_test ${knowhere_libs} ${unittest_libs})
target_link_libraries(test_wrapper
knowhere
${unittest_libs})
install(TARGETS wrapper_test DESTINATION unittest)
\ No newline at end of file
install(TARGETS test_wrapper DESTINATION unittest)
\ No newline at end of file
......@@ -16,7 +16,7 @@
// under the License.
#include "utils/easylogging++.h"
#include "src/wrapper/VecIndex.h"
#include "wrapper/VecIndex.h"
#include "knowhere/index/vector_index/helpers/FaissGpuResourceMgr.h"
#include "knowhere/index/vector_index/helpers/IndexParameter.h"
#include "wrapper/utils.h"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册