Upgrade to knowhere v1.1.5 to fully support MinGW build (#16498)

Signed-off-by: yudong.cai <yudong.cai@zilliz.com>
pull/16491/head
Cai Yudong 2022-04-15 09:53:34 +08:00 committed by GitHub
parent 58ea38142f
commit 35e7ed45b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 47 deletions

View File

@ -1,31 +0,0 @@
// Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "common/BitsetView.h"
namespace milvus {
BitsetView
BitsetView::subview(size_t offset, size_t size) const {
if (empty()) {
return BitsetView();
}
assert(offset % 8 == 0);
assert((offset + size) <= this.size());
return BitsetView(data() + offset / 8, size);
}
} // namespace milvus

View File

@ -18,22 +18,21 @@
#include <deque>
#include <boost_ext/dynamic_bitset_ext.hpp>
#include "common/Types.h"
#include "knowhere/utils/BitsetView.h"
namespace milvus {
class BitsetView : public faiss::BitsetView {
using BaseBitsetView = faiss::BitsetView;
public:
BitsetView() = default;
~BitsetView() = default;
BitsetView(const std::nullptr_t value) : BaseBitsetView(value) { // NOLINT
BitsetView(const std::nullptr_t value) : faiss::BitsetView(value) { // NOLINT
}
BitsetView(const uint8_t* data, size_t num_bits) : BaseBitsetView(data, num_bits) { // NOLINT
BitsetView(const uint8_t* data, size_t num_bits) : faiss::BitsetView(data, num_bits) { // NOLINT
}
BitsetView(const BitsetType& bitset) // NOLINT
@ -47,7 +46,14 @@ class BitsetView : public faiss::BitsetView {
}
BitsetView
subview(size_t pos, size_t count) const;
subview(size_t offset, size_t size) const {
if (empty()) {
return BitsetView();
}
assert((offset & 0x7) == 0);
assert((offset + size) <= this->size());
return BitsetView(data() + (offset >> 3), size);
}
};
} // namespace milvus

View File

@ -12,7 +12,6 @@
set(COMMON_SRC
Schema.cpp
Types.cpp
BitsetView.cpp
SystemProperty.cpp
vector_index_c.cpp
)

View File

@ -11,8 +11,8 @@
# or implied. See the License for the specific language governing permissions and limitations under the License.
#-------------------------------------------------------------------------------
set( KNOWHERE_VERSION v1.1.4 )
set( KNOWHERE_SOURCE_MD5 "605a11509d54e4af1f6c4f23de8beaa9" )
set( KNOWHERE_VERSION v1.1.5 )
set( KNOWHERE_SOURCE_MD5 "5baa7ecaea0e9e5c9f3f440cf8757d3c")
if ( DEFINED ENV{MILVUS_KNOWHERE_URL} )
set( KNOWHERE_SOURCE_URL "$ENV{MILVUS_KNOWHERE_URL}" )
@ -21,13 +21,6 @@ else ()
"https://github.com/milvus-io/knowhere/archive/refs/tags/${KNOWHERE_VERSION}.tar.gz" )
endif ()
if (MSYS)
# TODO(matrixji) replace with official release after `support windows` merged/tagged
# windows adaptation + milvus-io/knowhere@v1.1.3
set (KNOWHERE_SOURCE_URL "https://github.com/matrixji/knowhere/archive/refs/tags/v1.1.3-win.tar.gz")
set (KNOWHERE_SOURCE_MD5 "58021c73c4dc9fce40f429c02968bf79")
endif (MSYS)
macro(build_knowhere)
message(STATUS "Building knowhere-${KNOWHERE_VERSION} from source")
set (KNOWHERE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
@ -40,7 +33,7 @@ macro(build_knowhere)
externalproject_add(knowhere_ep
#GIT_REPOSITORY "https://github.com/milvus-io/knowhere.git"
#GIT_TAG v1.0.1
#GIT_TAG main
URL ${KNOWHERE_SOURCE_URL}
URL_MD5 ${KNOWHERE_SOURCE_MD5}
CMAKE_ARGS ${KNOWHERE_CMAKE_ARGS}