C API
Source header: cuvs/core/c_api.h
cuVS Error Messages
cuvsError_t
An enum denoting error statuses for function calls
Values
cuvsGetLastErrorText
Returns a string describing the last seen error on this thread, or
NULL if the last function succeeded.
Returns
CUVS_EXPORT const char*
cuvsSetLastErrorText
Sets a string describing an error seen on the thread. Passing NULL
clears any previously seen error message.
Parameters
Returns
CUVS_EXPORT void
cuVS Logging
cuvsLogLevel_t
An enum denoting log levels
Values
cuvsGetLogLevel
Returns the current log level
Returns
cuvsSetLogLevel
Sets the log level
Parameters
Returns
CUVS_EXPORT void
cuVS Resources Handle
cuvsResources_t
An opaque C handle for C++ type raft::resources
cuvsResourcesCreate
Create an Initialized opaque C handle for C++ type raft::resources
Parameters
Returns
cuvsResourcesDestroy
Destroy and de-allocate opaque C handle for C++ type raft::resources
Parameters
Returns
cuvsStreamSet
Set cudaStream_t on cuvsResources_t to queue CUDA kernels on APIs
that accept a cuvsResources_t handle
Parameters
Returns
cuvsStreamGet
Get the cudaStream_t from a cuvsResources_t
Parameters
Returns
cuvsStreamSync
Syncs the current CUDA stream on the resources object
Parameters
Returns
cuvsDeviceIdGet
Get the id of the device associated with this cuvsResources_t
Parameters
Returns
cuvsMultiGpuResourcesCreate
Create an Initialized opaque C handle for C++ type raft::device_resources_snmg
for multi-GPU operations
Parameters
Returns
cuvsMultiGpuResourcesCreateWithDeviceIds
Create an Initialized opaque C handle for C++ type raft::device_resources_snmg
for multi-GPU operations with specific device IDs
Parameters
Returns
cuvsMultiGpuResourcesDestroy
Destroy and de-allocate opaque C handle for C++ type raft::device_resources_snmg
Parameters
Returns
cuvsMultiGpuResourcesSetMemoryPool
Set a memory pool on all devices managed by the multi-GPU resources
Parameters
Returns
cuVS Memory Allocation
cuvsRMMAlloc
Allocates device memory using RMM
Parameters
Returns
cuvsRMMFree
Deallocates device memory using RMM
Parameters
Returns
cuvsRMMPoolMemoryResourceEnable
Switches the working memory resource to use the RMM pool memory resource, which will
bypass unnecessary synchronizations by allocating a chunk of device memory up front and carving that up for temporary memory allocations within algorithms. Be aware that this function will change the memory resource for the whole process and the new memory resource will be used until explicitly changed.
available memory available memory
Parameters
Returns
cuvsRMMMemoryResourceReset
Resets the memory resource to use the default memory resource (cuda_memory_resource)
Returns
cuvsRMMHostAlloc
Allocates pinned memory on the host using RMM
Parameters
Returns
cuvsRMMHostFree
Deallocates pinned memory on the host using RMM
Parameters
Returns
cuvsVersionGet
Get the version of the cuVS library
Parameters
Returns
cuvsMatrixCopy
Copy a matrix
This function copies a matrix from dst to src. This lets you copy a matrix from device memory to host memory (or vice versa), while accounting for differences in strides.
Both src and dst must have the same shape and dtype, but can have different strides and device type. The memory for the output dst tensor must already be allocated and the tensor initialized.
Parameters
Returns
cuvsMatrixSliceRows
Slices rows from a matrix
Parameters
Returns