Execution Resources
Most NVIDIA cuVS C++ APIs accept raft::resources const& as the first argument. Resource objects carry execution state such as CUDA streams, CUDA library handles, memory resources, stream pools, and communication resources.
raft::resources
Source header: raft/core/resources.hpp
Primary execution context passed to most NVIDIA cuVS C++ APIs. The object gives algorithms access to shared CUDA streams, library handles, memory resources, and other lazily-created state.
raft::resource::get_cuda_stream
Source header: raft/core/resource/cuda_stream.hpp
Returns the CUDA stream associated with a resources object.
Parameters
Returns
rmm::cuda_stream_view
raft::resource::sync_stream
Source header: raft/core/resource/cuda_stream.hpp
Synchronizes the CUDA stream associated with a resources object.
Parameters
Returns
void
raft::resource::set_cuda_stream_pool
Source header: raft/core/resource/cuda_stream_pool.hpp
Attaches a CUDA stream pool to a resources object so algorithms can issue independent work on multiple streams.
Parameters
Returns
void
raft::resource::get_stream_from_stream_pool
Source header: raft/core/resource/cuda_stream_pool.hpp
Returns a stream from the configured stream pool.
Parameters
Returns
rmm::cuda_stream_view
raft::resource::sync_stream_pool
Source header: raft/core/resource/cuda_stream_pool.hpp
Synchronizes streams in the configured stream pool.
Parameters
Returns
void
raft::resource::set_workspace_to_pool_resource
Source header: raft/core/resource/workspace_resource.hpp
Configures workspace allocation for algorithms that need temporary device memory.
Parameters
Returns
void
raft::resource::comms_initialized
Source header: raft/core/resource/comms.hpp
Reports whether communication resources have been initialized.
Parameters
Returns
bool
raft::resource::is_multi_gpu
Source header: raft/core/resource/comms.hpp
Reports whether a resources object is configured for multi-GPU use.
Parameters
Returns
bool
raft::device_resources
Source header: raft/core/device_resources.hpp
Convenience raft::resources implementation for single-GPU applications and examples.
raft::device_resources::device_resources
Constructs a single-GPU resources object.
Parameters
raft::device_resources::sync_stream
Synchronizes either the main stream or a specific CUDA stream.
Parameters
Returns
void
raft::device_resources::get_stream
Returns the main CUDA stream associated with the resources object.
Returns
rmm::cuda_stream_view
raft::device_resources::is_stream_pool_initialized
Reports whether a CUDA stream pool is configured.
Returns
bool
raft::device_resources::get_stream_pool
Returns the configured CUDA stream pool.
Returns
rmm::cuda_stream_pool const&
raft::device_resources::get_stream_from_stream_pool
Returns a stream from the configured CUDA stream pool.
Parameters
Returns
rmm::cuda_stream_view
raft::device_resources::get_next_usable_stream
Returns a stream from the pool when one exists; otherwise returns the main stream.
Parameters
Returns
rmm::cuda_stream_view
raft::device_resources::sync_stream_pool
Synchronizes all streams in the pool or a subset of stream indices.
Parameters
Returns
void
raft::device_resources::wait_stream_pool_on_stream
Makes the stream pool wait on work submitted to the main stream.
Returns
void
raft::device_resources_snmg
Source header: raft/core/device_resources_snmg.hpp
Single-node multi-GPU resources object used by C++ APIs that operate over more than one local GPU.
raft::device_resources_snmg::device_resources_snmg
Constructs single-node multi-GPU resources for all GPUs or a subset.
Parameters
raft::device_resources_snmg::set_memory_pool
Configures a memory pool on all GPUs managed by the resources object.
Parameters
Returns
void
raft::device_resources_snmg::has_resource_factory
Reports whether a resource factory is registered for a resource type.
Parameters
Returns
bool