RMM
23.12
RAPIDS Memory Manager
|
Modules | |
Device Memory Resources | |
Host Memory Resources | |
Device Resource Adaptors | |
Functions | |
device_memory_resource * | rmm::mr::get_per_device_resource (cuda_device_id device_id) |
Get the resource for the specified device. More... | |
device_memory_resource * | rmm::mr::set_per_device_resource (cuda_device_id device_id, device_memory_resource *new_mr) |
Set the device_memory_resource for the specified device. More... | |
device_memory_resource * | rmm::mr::get_current_device_resource () |
Get the memory resource for the current device. More... | |
device_memory_resource * | rmm::mr::set_current_device_resource (device_memory_resource *new_mr) |
Set the memory resource for the current device. More... | |
|
inline |
Get the memory resource for the current device.
Returns a pointer to the resource set for the current device. The initial resource is a cuda_memory_resource
.
The "current device" is the device returned by cudaGetDevice
.
This function is thread-safe with respect to concurrent calls to set_per_device_resource
, get_per_device_resource
, get_current_device_resource
, and set_current_device_resource
. Concurrent calls to any of these functions will result in a valid state, but the order of execution is undefined.
device_memory_resource
should only be used with the current CUDA device. Changing the current device (e.g. using cudaSetDevice()
) and then using the returned resource can result in undefined behavior. The behavior of a device_memory_resource is undefined if used while the active CUDA device is a different device from the one that was active when the device_memory_resource was created.
|
inline |
Get the resource for the specified device.
Returns a pointer to the device_memory_resource
for the specified device. The initial resource is a cuda_memory_resource
.
id.value()
must be in the range [0, cudaGetDeviceCount())
, otherwise behavior is undefined.
This function is thread-safe with respect to concurrent calls to set_per_device_resource
, get_per_device_resource
, get_current_device_resource
, and set_current_device_resource
. Concurrent calls to any of these functions will result in a valid state, but the order of execution is undefined.
device_memory_resource
should only be used when CUDA device id
is the current device (e.g. set using cudaSetDevice()
). The behavior of a device_memory_resource is undefined if used while the active CUDA device is a different device from the one that was active when the device_memory_resource was created.device_id | The id of the target device |
device_memory_resource
for device id
|
inline |
Set the memory resource for the current device.
If new_mr
is not nullptr
, sets the resource pointer for the current device to new_mr
. Otherwise, resets the resource to the initial cuda_memory_resource
.
The "current device" is the device returned by cudaGetDevice
.
The object pointed to by new_mr
must outlive the last use of the resource, otherwise behavior is undefined. It is the caller's responsibility to maintain the lifetime of the resource object.
This function is thread-safe with respect to concurrent calls to set_per_device_resource
, get_per_device_resource
, get_current_device_resource
, and set_current_device_resource
. Concurrent calls to any of these functions will result in a valid state, but the order of execution is undefined.
new_mr
must have been created for the current CUDA device. The behavior of a device_memory_resource is undefined if used while the active CUDA device is a different device from the one that was active when the device_memory_resource was created.new_mr | If not nullptr , pointer to new resource to use for the current device |
|
inline |
Set the device_memory_resource
for the specified device.
If new_mr
is not nullptr
, sets the memory resource pointer for the device specified by id
to new_mr
. Otherwise, resets id
s resource to the initial cuda_memory_resource
.
id.value()
must be in the range [0, cudaGetDeviceCount())
, otherwise behavior is undefined.
The object pointed to by new_mr
must outlive the last use of the resource, otherwise behavior is undefined. It is the caller's responsibility to maintain the lifetime of the resource object.
This function is thread-safe with respect to concurrent calls to set_per_device_resource
, get_per_device_resource
, get_current_device_resource
, and set_current_device_resource
. Concurrent calls to any of these functions will result in a valid state, but the order of execution is undefined.
new_mr
must have been created when device id
was the current CUDA device (e.g. set using cudaSetDevice()
). The behavior of a device_memory_resource is undefined if used while the active CUDA device is a different device from the one that was active when the device_memory_resource was created.device_id | The id of the target device |
new_mr | If not nullptr , pointer to new device_memory_resource to use as new resource for id |
id