cuda::experimental::managed_memory_pool#

class managed_memory_pool : public cuda::experimental::__memory_pool_base#

managed_memory_pool is an owning wrapper around a cudaMemPool_t.

It handles creation and destruction of the underlying pool utilizing the provided memory_pool_properties.

Public Types

using resource_type = managed_memory_resource#

Public Functions

inline explicit managed_memory_pool(
memory_pool_properties __properties = {},
)#

Constructs a managed_memory_pool with optional properties.

Properties include the initial pool size and the release threshold. If the pool size grows beyond the release threshold, unused memory held by the pool will be released at the next synchronization event.

Parameters:

__properties – Optional, additional properties of the pool to be created.

managed_memory_pool(::cudaMemPool_t) = delete#

Disables construction from a plain cudaMemPool_t. We want to ensure clean ownership semantics.

managed_memory_pool(managed_memory_pool const&) = delete#
managed_memory_pool(managed_memory_pool&&) = delete#
managed_memory_pool &operator=(managed_memory_pool const&) = delete#
managed_memory_pool &operator=(managed_memory_pool&&) = delete#

Public Static Functions

static inline managed_memory_pool from_native_handle(
::cudaMemPool_t __handle,
) noexcept#

Construct an pinned_memory_pool object from a native cudaMemPool_t handle.

Note

The constructed pinned_memory_pool object takes ownership of the native handle.

Parameters:

__handle – The native handle

Returns:

The constructed pinned_memory_pool object

static managed_memory_pool from_native_handle(int) = delete#
static managed_memory_pool from_native_handle(
::cuda::std::nullptr_t,
) = delete#