XVector
xvec_buffer.h File Reference

Buffer management for the XVector library. More...

#include "xvec_types.h"
Include dependency graph for xvec_buffer.h:

Go to the source code of this file.

Functions

xvecStatus xvecCreateBuffer (xvecExecutionContextTag *context, size_t size, xvecBufferTag **outBuffer)
 Create a buffer. More...
 
xvecStatus xvecDestroyBuffer (xvecExecutionContextTag *context, xvecBufferTag *buffer)
 Destroy a buffer. More...
 
xvecStatus xvecGetBufferData (xvecBufferTag *buffer, void **outData)
 Get the data pointer of the buffer. More...
 
xvecStatus xvecGetBufferSize (xvecBufferTag *buffer, size_t *outSize)
 Get the size of the buffer. More...
 
xvecStatus xvecGetBufferSlice (xvecBufferTag *buffer, xvecBufferSlice *outSlice)
 Get both data pointer and size of the buffer as a slice. More...
 

Detailed Description

Buffer management for the XVector library.

This header provides the API for creating, accessing, and destroying buffers. Buffers are used to store vector data, query vectors, and search results that can be efficiently transferred to/from device memory.

Definition in file xvec_buffer.h.

Function Documentation

◆ xvecCreateBuffer()

xvecStatus xvecCreateBuffer ( xvecExecutionContextTag *  context,
size_t  size,
xvecBufferTag **  outBuffer 
)

Create a buffer.

Parameters
[in]contextExecution context
[in]sizeSize of the buffer to be created
[out]outBufferOutput pointer that receives that allocated buffer address.
Returns
xvecStatus

◆ xvecDestroyBuffer()

xvecStatus xvecDestroyBuffer ( xvecExecutionContextTag *  context,
xvecBufferTag *  buffer 
)

Destroy a buffer.

Releases the buffer immediately and frees associated resources.

Parameters
[in]contextExecution context
[in]bufferPointer previously returned by xvecCreateBuffer
Returns
xvecStatus

◆ xvecGetBufferData()

xvecStatus xvecGetBufferData ( xvecBufferTag *  buffer,
void **  outData 
)

Get the data pointer of the buffer.

Parameters
[in]bufferPointer to the buffer
[out]outDataOutput pointer that receives the data pointer of the buffer.
Returns
xvecStatus

◆ xvecGetBufferSize()

xvecStatus xvecGetBufferSize ( xvecBufferTag *  buffer,
size_t *  outSize 
)

Get the size of the buffer.

Parameters
[in]bufferPointer to the buffer
[out]outSizeOutput pointer that receives the size of the buffer.
Returns
xvecStatus

◆ xvecGetBufferSlice()

xvecStatus xvecGetBufferSlice ( xvecBufferTag *  buffer,
xvecBufferSlice *  outSlice 
)

Get both data pointer and size of the buffer as a slice.

Parameters
[in]bufferPointer to the buffer
[out]outSliceOutput pointer to an xvecBufferSlice structure to populate.
Returns
xvecStatus