Loading cpp/build-support/lint_exclusions.txt +1 −2 Original line number Diff line number Diff line Loading @@ -6,4 +6,3 @@ *easylogging++* *SqliteMetaImpl.cpp *src/grpc* No newline at end of file *src/core* No newline at end of file cpp/src/core/knowhere/knowhere/adapter/ArrowAdapter.cpp +13 −14 Original line number Diff line number Diff line Loading @@ -15,8 +15,7 @@ // specific language governing permissions and limitations // under the License. #include "ArrowAdapter.h" #include "knowhere/adapter/ArrowAdapter.h" namespace zilliz { namespace knowhere { Loading @@ -36,7 +35,8 @@ CopyArray(const ArrayPtr &origin) { DEFINE_TYPE(DECIMAL, Decimal128Array) DEFINE_TYPE(FLOAT, NumericArray<arrow::FloatType>) DEFINE_TYPE(INT64, NumericArray<arrow::Int64Type>) default:break; default: break; } return copy; } Loading @@ -51,6 +51,5 @@ CopySchema(const SchemaPtr &origin) { return std::make_shared<Schema>(std::move(fields)); } } // namespace knowhere } // namespace zilliz cpp/src/core/knowhere/knowhere/adapter/ArrowAdapter.h +6 −6 Original line number Diff line number Diff line Loading @@ -15,14 +15,14 @@ // specific language governing permissions and limitations // under the License. #pragma once #include <memory> #include <utility> #include <vector> #include "knowhere/common/Array.h" namespace zilliz { namespace knowhere { Loading cpp/src/core/knowhere/knowhere/adapter/SptagAdapter.cpp +26 −33 Original line number Diff line number Diff line Loading @@ -15,15 +15,13 @@ // specific language governing permissions and limitations // under the License. #include "knowhere/adapter/SptagAdapter.h" #include "knowhere/adapter/Structure.h" #include "knowhere/index/vector_index/helpers/Definitions.h" #include "SptagAdapter.h" #include "Structure.h" namespace zilliz { namespace knowhere { std::shared_ptr<SPTAG::MetadataSet> ConvertToMetadataSet(const DatasetPtr& dataset) { auto array = dataset->array()[0]; Loading @@ -31,14 +29,11 @@ ConvertToMetadataSet(const DatasetPtr &dataset) { auto p_data = array->data()->GetValues<int64_t>(1, 0); auto p_offset = (int64_t*)malloc(sizeof(int64_t) * elems); for (auto i = 0; i <= elems; ++i) p_offset[i] = i * 8; std::shared_ptr<SPTAG::MetadataSet> metaset(new SPTAG::MemMetadataSet( SPTAG::ByteArray((std::uint8_t *) p_data, elems * sizeof(int64_t), false), SPTAG::ByteArray((std::uint8_t *) p_offset, elems * sizeof(int64_t), true), elems)); for (auto i = 0; i <= elems; ++i) p_offset[i] = i * 8; std::shared_ptr<SPTAG::MetadataSet> metaset( new SPTAG::MemMetadataSet(SPTAG::ByteArray((std::uint8_t*)p_data, elems * sizeof(int64_t), false), SPTAG::ByteArray((std::uint8_t*)p_offset, elems * sizeof(int64_t), true), elems)); return metaset; } Loading @@ -54,10 +49,8 @@ ConvertToVectorSet(const DatasetPtr &dataset) { SPTAG::ByteArray byte_array(p_data, num_bytes, false); auto vectorset = std::make_shared<SPTAG::BasicVectorSet>(byte_array, SPTAG::VectorValueType::Float, dimension, rows); auto vectorset = std::make_shared<SPTAG::BasicVectorSet>(byte_array, SPTAG::VectorValueType::Float, dimension, rows); return vectorset; } Loading cpp/src/core/knowhere/knowhere/adapter/SptagAdapter.h +7 −8 Original line number Diff line number Diff line Loading @@ -15,12 +15,11 @@ // specific language governing permissions and limitations // under the License. #pragma once #include <memory> #include <SPTAG/AnnService/inc/Core/VectorIndex.h> #include <memory> #include <vector> #include "knowhere/common/Dataset.h" Loading Loading
cpp/build-support/lint_exclusions.txt +1 −2 Original line number Diff line number Diff line Loading @@ -6,4 +6,3 @@ *easylogging++* *SqliteMetaImpl.cpp *src/grpc* No newline at end of file *src/core* No newline at end of file
cpp/src/core/knowhere/knowhere/adapter/ArrowAdapter.cpp +13 −14 Original line number Diff line number Diff line Loading @@ -15,8 +15,7 @@ // specific language governing permissions and limitations // under the License. #include "ArrowAdapter.h" #include "knowhere/adapter/ArrowAdapter.h" namespace zilliz { namespace knowhere { Loading @@ -36,7 +35,8 @@ CopyArray(const ArrayPtr &origin) { DEFINE_TYPE(DECIMAL, Decimal128Array) DEFINE_TYPE(FLOAT, NumericArray<arrow::FloatType>) DEFINE_TYPE(INT64, NumericArray<arrow::Int64Type>) default:break; default: break; } return copy; } Loading @@ -51,6 +51,5 @@ CopySchema(const SchemaPtr &origin) { return std::make_shared<Schema>(std::move(fields)); } } // namespace knowhere } // namespace zilliz
cpp/src/core/knowhere/knowhere/adapter/ArrowAdapter.h +6 −6 Original line number Diff line number Diff line Loading @@ -15,14 +15,14 @@ // specific language governing permissions and limitations // under the License. #pragma once #include <memory> #include <utility> #include <vector> #include "knowhere/common/Array.h" namespace zilliz { namespace knowhere { Loading
cpp/src/core/knowhere/knowhere/adapter/SptagAdapter.cpp +26 −33 Original line number Diff line number Diff line Loading @@ -15,15 +15,13 @@ // specific language governing permissions and limitations // under the License. #include "knowhere/adapter/SptagAdapter.h" #include "knowhere/adapter/Structure.h" #include "knowhere/index/vector_index/helpers/Definitions.h" #include "SptagAdapter.h" #include "Structure.h" namespace zilliz { namespace knowhere { std::shared_ptr<SPTAG::MetadataSet> ConvertToMetadataSet(const DatasetPtr& dataset) { auto array = dataset->array()[0]; Loading @@ -31,14 +29,11 @@ ConvertToMetadataSet(const DatasetPtr &dataset) { auto p_data = array->data()->GetValues<int64_t>(1, 0); auto p_offset = (int64_t*)malloc(sizeof(int64_t) * elems); for (auto i = 0; i <= elems; ++i) p_offset[i] = i * 8; std::shared_ptr<SPTAG::MetadataSet> metaset(new SPTAG::MemMetadataSet( SPTAG::ByteArray((std::uint8_t *) p_data, elems * sizeof(int64_t), false), SPTAG::ByteArray((std::uint8_t *) p_offset, elems * sizeof(int64_t), true), elems)); for (auto i = 0; i <= elems; ++i) p_offset[i] = i * 8; std::shared_ptr<SPTAG::MetadataSet> metaset( new SPTAG::MemMetadataSet(SPTAG::ByteArray((std::uint8_t*)p_data, elems * sizeof(int64_t), false), SPTAG::ByteArray((std::uint8_t*)p_offset, elems * sizeof(int64_t), true), elems)); return metaset; } Loading @@ -54,10 +49,8 @@ ConvertToVectorSet(const DatasetPtr &dataset) { SPTAG::ByteArray byte_array(p_data, num_bytes, false); auto vectorset = std::make_shared<SPTAG::BasicVectorSet>(byte_array, SPTAG::VectorValueType::Float, dimension, rows); auto vectorset = std::make_shared<SPTAG::BasicVectorSet>(byte_array, SPTAG::VectorValueType::Float, dimension, rows); return vectorset; } Loading
cpp/src/core/knowhere/knowhere/adapter/SptagAdapter.h +7 −8 Original line number Diff line number Diff line Loading @@ -15,12 +15,11 @@ // specific language governing permissions and limitations // under the License. #pragma once #include <memory> #include <SPTAG/AnnService/inc/Core/VectorIndex.h> #include <memory> #include <vector> #include "knowhere/common/Dataset.h" Loading