/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include #include #include #include namespace faiss { namespace gpu { /// Append user indices to IVF lists void runIVFIndicesAppend( Tensor& listIds, Tensor& listOffset, Tensor& indices, IndicesOptions opt, thrust::device_vector& listIndices, hipStream_t stream); /// Update device-side list pointers in a batch void runUpdateListPointers( Tensor& listIds, Tensor& newListLength, Tensor& newCodePointers, Tensor& newIndexPointers, thrust::device_vector& listLengths, thrust::device_vector& listCodes, thrust::device_vector& listIndices, hipStream_t stream); /// Append PQ codes to IVF lists (non-interleaved format) void runIVFPQAppend( Tensor& listIds, Tensor& listOffset, Tensor& encodings, thrust::device_vector& listCodes, hipStream_t stream); /// Append PQ codes to IVF lists (interleaved format) void runIVFPQInterleavedAppend( Tensor& listIds, Tensor& listOffset, Tensor& uniqueLists, Tensor& vectorsByUniqueList, Tensor& uniqueListVectorStart, Tensor& uniqueListStartOffset, int bitsPerCode, Tensor& encodings, thrust::device_vector& listCodes, hipStream_t stream); /// Append SQ codes to IVF lists (non-interleaved, old format) void runIVFFlatAppend( Tensor& listIds, Tensor& listOffset, Tensor& vecs, GpuScalarQuantizer* scalarQ, thrust::device_vector& listData, hipStream_t stream); /// Append SQ codes to IVF lists (interleaved) void runIVFFlatInterleavedAppend( Tensor& listIds, Tensor& listOffset, Tensor& uniqueLists, Tensor& vectorsByUniqueList, Tensor& uniqueListVectorStart, Tensor& uniqueListStartOffset, Tensor& vecs, GpuScalarQuantizer* scalarQ, thrust::device_vector& listData, GpuResources* res, hipStream_t stream); } // namespace gpu } // namespace faiss