cuda::experimental::pinned_memory_pool#
-
class pinned_memory_pool : public cuda::experimental::__memory_pool_base#
pinned_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 Functions
- inline explicit pinned_memory_pool(
- int __numa_id,
- memory_pool_properties __properties,
Constructs a
pinned_memory_pool
with the specified NUMA node id and initial pool size and 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.
Note
Memory from this pool is accessible from all devices right away, which differs from the default behavior of pinned memory pools where memory is not accessible from devices until
cudaMemPoolSetAccess
is called.- Parameters:
__numa_id – The NUMA node id of the NUMA node the pool is constructed on.
__pool_properties – Optional, additional properties of the pool to be created.
-
inline explicit pinned_memory_pool(int __numa_id = 0)#
Constructs a
pinned_memory_pool
on the host with the specified NUMA node id.Note
Memory from this pool is accessible from all devices right away, which differs from the default behavior of pinned memory pools where memory is not accessible from devices until
cudaMemPoolSetAccess
is called.- Parameters:
__numa_id – The NUMA node id of the NUMA node the pool is constructed on.
__numa_id – The NUMA node id of the NUMA node the pool is constructed on.
-
pinned_memory_pool(::cudaMemPool_t) = delete#
Disables construction from a plain
cudaMemPool_t
. We want to ensure clean ownership semantics.
-
pinned_memory_pool(pinned_memory_pool const&) = delete#
-
pinned_memory_pool(pinned_memory_pool&&) = delete#
-
pinned_memory_pool &operator=(pinned_memory_pool const&) = delete#
-
pinned_memory_pool &operator=(pinned_memory_pool&&) = delete#
Public Static Functions
- static inline pinned_memory_pool from_native_handle(
- ::cudaMemPool_t __handle,
Construct an
pinned_memory_pool
object from a nativecudaMemPool_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 pinned_memory_pool from_native_handle(int) = delete#
- static pinned_memory_pool from_native_handle(
- ::cuda::std::nullptr_t,