XVector
xvec_hnsw_flat_index.hpp File Reference

C++ RAII wrapper for the XVECTOR HNSW-Flat index. More...

#include <string>
#include "xvector/xvec_hnsw_flat.h"
#include "xvector/xvec_types.h"
#include "xvector_cpp/xvec_error.hpp"
Include dependency graph for xvec_hnsw_flat_index.hpp:

Go to the source code of this file.

Classes

class  xvec::HnswFlatIndex
 RAII wrapper for xvecHnswFlatIndexTag. More...
 

Namespaces

 xvec
 

Detailed Description

C++ RAII wrapper for the XVECTOR HNSW-Flat index.

// Load from Faiss file (RAII); the index is uploaded to the device here.
auto index = xvec::HnswFlatIndex::fromFaissFile(ctx.handle(), "index.faiss");
// Use the raw handle for C API interop.
xvecHnswFlatSearch(ctx.handle(), index.handle(), &query, resultBuf, &timing);
// Index is automatically destroyed when out of scope.
static HnswFlatIndex fromFaissFile(xvecExecutionContextTag *context, const std::string &path)
Load an HNSW-Flat index from a Faiss file (and upload it to device).
xvecStatus xvecHnswFlatSearch(xvecExecutionContextTag *context, xvecHnswFlatIndexTag *indexHandle, xvecHnswFlatSearchQueryFloat32 *searchQuery, xvecBufferTag *resultsBufferHandle, xvecHnswFlatSearchTiming *outTiming)
Performs an HNSW-Flat search.
C++ RAII wrapper for the XVECTOR HNSW-Flat index.

Definition in file xvec_hnsw_flat_index.hpp.