cuda::experimental::pinned_memory_pool#
-
struct pinned_memory_pool : public cuda::experimental::pinned_memory_resource#
Stream ordered memory resource#
pinned_memory_pool
allocates pinned memory using cudaMallocFromPoolAsync / cudaFreeAsync for allocation/deallocation. When constructed it creates an underlying c cudaMemPool_t with the location type set to c cudaMemLocationTypeHost or c cudaMemLocationTypeHostNuma and owns it.Public Types
-
using reference_type = pinned_memory_resource#
-
using default_queries = ::cuda::mr::properties_list<::cuda::mr::device_accessible, ::cuda::mr::host_accessible>#
Public Functions
-
inline pinned_memory_pool(memory_pool_properties __properties = {})#
Constructs a
pinned_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.
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:
__properties – Optional, additional properties of the pool to be created.
- inline pinned_memory_pool(
- int __numa_id,
- memory_pool_properties __properties = {},
Constructs a
pinned_memory_pool
with the specified NUMA node id and 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.
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 ~pinned_memory_pool() noexcept#
-
pinned_memory_pool(const pinned_memory_pool&) = delete#
-
pinned_memory_pool &operator=(const pinned_memory_pool&) = delete#
Public Static Functions
- static inline pinned_memory_pool from_native_handle(
- ::cudaMemPool_t __pool,
-
using reference_type = pinned_memory_resource#