milvus/cpp/unittest/server/cache_test.cpp
groot 97d4738bc6 rewrite cache code
Former-commit-id: 00247bcda3df3d0e29bc4a809f7894ce92470e0e
2019-04-24 11:52:13 +08:00

21 lines
787 B
C++

////////////////////////////////////////////////////////////////////////////////
// Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved
// Unauthorized copying of this file, via any medium is strictly prohibited.
// Proprietary and confidential.
////////////////////////////////////////////////////////////////////////////////
#include <gtest/gtest.h>
#include "cache/CpuCacheMgr.h"
#include "cache/GpuCacheMgr.h"
using namespace zilliz::vecwise;
TEST(CacheTest, CACHE_TEST) {
cache::CacheMgr* cpu_mgr = cache::CpuCacheMgr::GetInstance();
cache::CacheMgr* gpu_mgr = cache::GpuCacheMgr::GetInstance();
cpu_mgr->SetCapacity(15);
ASSERT_EQ(cpu_mgr->CacheCapacity(), 15);
gpu_mgr->SetCapacity(2);
ASSERT_EQ(gpu_mgr->CacheCapacity(), 2);
}