Public Member Functions | List of all members
cudf::memory_resources Class Reference

Non-owning references to the memory resources used by a cuDF operation. More...

#include <cudf/utilities/memory_resource.hpp>

Public Member Functions

template<typename Resource >
 memory_resources (Resource &&output_mr)
 Construct with an explicit output resource and capture the current resource for temporaries. More...
 
template<typename OutputResource , typename TemporaryResource >
 memory_resources (OutputResource &&output_mr, TemporaryResource &&temporary_mr)
 Construct with explicit output and temporary resources. More...
 
rmm::device_async_resource_ref get_output_mr () const noexcept
 Return the resource used for allocations returned to the caller. More...
 
rmm::device_async_resource_ref get_temporary_mr () const noexcept
 Return the resource used for intermediate allocations. More...
 

Detailed Description

Non-owning references to the memory resources used by a cuDF operation.

The output resource allocates memory returned to the caller. The temporary resource allocates intermediate memory that is released before the operation returns. If allocations are made from a resource ref, callers must construct an owning resource from the resource ref, keep that owning resource alive for the allocation's lifetime, and use it for deallocation.

Definition at line 47 of file memory_resource.hpp.

Constructor & Destructor Documentation

◆ memory_resources() [1/2]

template<typename Resource >
cudf::memory_resources::memory_resources ( Resource &&  output_mr)
inline

Construct with an explicit output resource and capture the current resource for temporaries.

This constructor is intentionally implicit so an existing resource object or resource ref can be passed directly to an API accepting memory_resources.

Template Parameters
ResourceType that can construct a device asynchronous resource ref
Parameters
output_mrResource used for returned allocations

Definition at line 60 of file memory_resource.hpp.

◆ memory_resources() [2/2]

template<typename OutputResource , typename TemporaryResource >
cudf::memory_resources::memory_resources ( OutputResource &&  output_mr,
TemporaryResource &&  temporary_mr 
)
inline

Construct with explicit output and temporary resources.

This constructor does not query the current device resource.

Template Parameters
OutputResourceType that can construct the output resource ref
TemporaryResourceType that can construct the temporary resource ref
Parameters
output_mrResource used for returned allocations
temporary_mrResource used for intermediate allocations

Definition at line 80 of file memory_resource.hpp.

Member Function Documentation

◆ get_output_mr()

rmm::device_async_resource_ref cudf::memory_resources::get_output_mr ( ) const
inlinenoexcept

Return the resource used for allocations returned to the caller.

Returns
Output device memory resource reference

Definition at line 95 of file memory_resource.hpp.

◆ get_temporary_mr()

rmm::device_async_resource_ref cudf::memory_resources::get_temporary_mr ( ) const
inlinenoexcept

Return the resource used for intermediate allocations.

Returns
Temporary device memory resource reference

Definition at line 102 of file memory_resource.hpp.


The documentation for this class was generated from the following file: