XVector
xvec_context.hpp File Reference

C++ RAII wrapper for the XVECTOR execution context. More...

#include <cstdint>
#include <optional>
#include <string>
#include <xvector_cpp/xvec_error.hpp>
#include "xvector/xvec_types.h"
Include dependency graph for xvec_context.hpp:

Go to the source code of this file.

Classes

class  xvec::Context
 RAII wrapper for xvecExecutionContextTag. More...
 

Namespaces

 xvec
 

Detailed Description

C++ RAII wrapper for the XVECTOR execution context.

This header provides a C++ wrapper around the C execution context API, offering RAII-based lifetime management, move semantics, and exception-based error handling.

// Create a context (RAII)
// Set properties. "numSub" is not among them: leave it unset and the context
// sizes its Job from the Subs the device reports.
ctx.setProperty("taskCount", "192");
// Use raw handle for C API interop
xvecIvfFlatLoadIndexFromFaissFile(ctx.handle(), path, &index);
// Context is automatically destroyed when out of scope
RAII wrapper for xvecExecutionContextTag.
C++ RAII wrapper for the XVECTOR execution context.
xvecStatus xvecIvfFlatLoadIndexFromFaissFile(xvecExecutionContextTag *context, const char *indexFilePath, xvecIvfFlatIndexTag **outIndexHandle)
Loads an IVF-Flat index from a Faiss index file.

Definition in file xvec_context.hpp.