Loading...
Searching...
No Matches
rmm Namespace Reference

The top-level namespace containing all RMM functionality. More...

Namespaces

namespace  mr
 Memory Resource classes and adaptors.

Classes

class  bad_alloc
 Exception thrown when an RMM allocation fails. More...
struct  cuda_device_id
 Strong type for a CUDA device identifier. More...
struct  cuda_error
 Exception thrown when a CUDA error is encountered. More...
struct  cuda_set_device_raii
 RAII class that sets the current CUDA device to the specified device on construction and restores the previous device on destruction. More...
class  cuda_stream
 Owning wrapper for a CUDA stream. More...
class  cuda_stream_pool
 A pool of CUDA streams. More...
class  device_buffer
 RAII construct for device memory allocation. More...
class  device_scalar
 Container for a single object of type T in device memory. More...
class  device_uvector
 An uninitialized vector of elements in device memory. More...
class  exec_policy
 Helper class usable as a Thrust CUDA execution policy that uses RMM for temporary memory allocation on the specified stream. More...
class  exec_policy_nosync
 Helper class usable as a Thrust CUDA execution policy that uses RMM for temporary memory allocation on the specified stream and which allows the Thrust backend to skip stream synchronizations that are not required for correctness. More...
class  invalid_argument
 Exception thrown when an argument to a function is invalid. More...
struct  logic_error
 Exception thrown when logical precondition is violated. More...
class  out_of_memory
 Exception thrown when RMM runs out of memory. More...
class  out_of_range
 Exception thrown when attempting to access outside of a defined range. More...

Typedefs

template<typename T>
using device_vector = thrust::device_vector<T, rmm::mr::thrust_allocator<T>>
 Alias for a thrust::device_vector that uses RMM for memory allocation.
using thrust_exec_policy_t
 Synchronous execution policy for allocations using Thrust.
using thrust_exec_policy_nosync_t
 Asynchronous execution policy for allocations using Thrust.
using device_resource_ref = cuda::mr::synchronous_resource_ref<cuda::mr::device_accessible>
 Alias for a cuda::mr::synchronous_resource_ref with the property cuda::mr::device_accessible.
using device_async_resource_ref = cuda::mr::resource_ref<cuda::mr::device_accessible>
 Alias for a cuda::mr::resource_ref with the property cuda::mr::device_accessible.
using host_resource_ref = cuda::mr::synchronous_resource_ref<cuda::mr::host_accessible>
 Alias for a cuda::mr::synchronous_resource_ref with the property cuda::mr::host_accessible.
using host_async_resource_ref = cuda::mr::resource_ref<cuda::mr::host_accessible>
 Alias for a cuda::mr::resource_ref with the property cuda::mr::host_accessible.
using host_device_resource_ref
 Alias for a cuda::mr::synchronous_resource_ref with the properties cuda::mr::host_accessible and cuda::mr::device_accessible.
using host_device_async_resource_ref
 Alias for a cuda::mr::resource_ref with the properties cuda::mr::host_accessible and cuda::mr::device_accessible.

Functions

bool is_pow2 (std::size_t value) noexcept
 Returns whether or not value is a power of 2.
bool is_supported_alignment (std::size_t alignment) noexcept
 Returns whether or not alignment is a valid memory alignment.
bool is_supported_base_resource_alignment (std::size_t alignment) noexcept
 Returns whether or not alignment is supported by base CUDA memory resources.
std::size_t align_up (std::size_t value, std::size_t alignment) noexcept
 Align up to nearest multiple of specified power of 2.
std::size_t align_down (std::size_t value, std::size_t alignment) noexcept
 Align down to the nearest multiple of specified power of 2.
bool is_aligned (std::size_t value, std::size_t alignment) noexcept
 Checks whether a value is aligned to a multiple of a specified power of 2.
bool is_pointer_aligned (void *ptr, std::size_t alignment=rmm::CUDA_ALLOCATION_ALIGNMENT) noexcept
 Checks whether the provided pointer is aligned to a specified alignment.
cuda_device_id get_current_cuda_device ()
 Returns a cuda_device_id for the current device.
int get_num_cuda_devices ()
 Returns the number of CUDA devices in the system.
std::pair< std::size_t, std::size_t > available_device_memory ()
 Returns the available and total device memory in bytes for the current device.
std::size_t percent_of_free_device_memory (int percent)
 Returns the approximate specified percent of available device memory on the current CUDA device, aligned (down) to the nearest CUDA allocation size.
rapids_logger::sink_ptr default_sink ()
 Returns the default sink for the global logger.
std::string default_pattern ()
 Returns the default log pattern for the global logger.
rapids_logger::logger & default_logger ()
 Get the default logger.
void prefetch (void const *ptr, std::size_t size, rmm::cuda_device_id device, cuda::stream_ref stream)
 Prefetch memory to the specified device on the specified stream.
template<typename T>
void prefetch (cuda::std::span< T const > data, rmm::cuda_device_id device, cuda::stream_ref stream)
 Prefetch a span of memory to the specified device on the specified stream.
bool process_is_exiting () noexcept
 Returns true if the process has entered exit() / atexit handler execution.
template<class Resource>
device_async_resource_ref to_device_async_resource_ref_checked (Resource *res)
 Convert pointer to memory resource into device_async_resource_ref, checking for nullptr.

Variables

static constexpr std::size_t CUDA_ALLOCATION_ALIGNMENT {256}
 Default alignment used for CUDA memory allocation.

Detailed Description

The top-level namespace containing all RMM functionality.

The rmm namespace provides a comprehensive set of memory management utilities for CUDA applications, including memory resources, CUDA stream management, device-side data containers, and memory allocation utilities.

Function Documentation

◆ default_logger()

rapids_logger::logger & rmm::default_logger ( )

Get the default logger.

Returns
logger& The default logger

◆ default_pattern()

std::string rmm::default_pattern ( )

Returns the default log pattern for the global logger.

Returns
std::string The default log pattern.

◆ default_sink()

rapids_logger::sink_ptr rmm::default_sink ( )

Returns the default sink for the global logger.

If the environment variable RMM_DEBUG_LOG_FILE is defined, the default sink is a sink to that file. Otherwise, the default is to dump to stderr.

Returns
sink_ptr The sink to use