pub unsafe extern "C" fn cudaMemPoolGetAttribute(
memPool: cudaMemPool_t,
attr: cudaMemPoolAttr,
value: *mut c_void,
) -> cudaError_tExpand description
Gets attributes of a memory pool.
Supported attributes are:
cudaMemPoolAttr::CU_MEMPOOL_ATTR_RELEASE_THRESHOLD: (value type = cuuint64_t) Amount of reserved memory in bytes to hold onto before trying to release memory back to the OS. When more than the release threshold bytes of memory are held by the memory pool, the allocator will try to release memory back to the OS on the next call to stream, event or context synchronize. (default 0)cudaMemPoolAttr::CU_MEMPOOL_ATTR_REUSE_FOLLOW_EVENT_DEPENDENCIES: (value type = int) AllowcudaMallocAsyncto use memory asynchronously freed in another stream as long as a stream ordering dependency of the allocating stream on the free action exists. CUDA events and null stream interactions can create the required stream ordered dependencies. (default enabled)cudaMemPoolAttr::CU_MEMPOOL_ATTR_REUSE_ALLOW_OPPORTUNISTIC: (value type = int) Allow reuse of already completed frees when there is no dependency between the free and allocation. (default enabled)cudaMemPoolAttr::CU_MEMPOOL_ATTR_REUSE_ALLOW_INTERNAL_DEPENDENCIES: (value type = int) AllowcudaMallocAsyncto insert new stream dependencies in order to establish the stream ordering required to reuse a piece of memory released bycudaFreeAsync(default enabled).cudaMemPoolAttr::CU_MEMPOOL_ATTR_RESERVED_MEM_CURRENT: (value type = cuuint64_t) Amount of backing memory currently allocated for the mempool.cudaMemPoolAttr::CU_MEMPOOL_ATTR_RESERVED_MEM_HIGH: (value type = cuuint64_t) High watermark of backing memory allocated for the mempool since the last time it was reset.cudaMemPoolAttr::CU_MEMPOOL_ATTR_USED_MEM_CURRENT: (value type = cuuint64_t) Amount of memory from the pool that is currently in use by the application.cudaMemPoolAttr::CU_MEMPOOL_ATTR_USED_MEM_HIGH: (value type = cuuint64_t) High watermark of the amount of memory from the pool that was in use by the application since the last time it was reset.
The following properties can be also be queried on imported and default pools:
cudaMemPoolAttr::CU_MEMPOOL_ATTR_ALLOCATION_TYPE: (value type = cudaMemAllocationType) The allocation type of the mempoolcudaMemPoolAttr::CU_MEMPOOL_ATTR_EXPORT_HANDLE_TYPES: (value type = cudaMemAllocationHandleType) Available export handle types for the mempool. For imported pools this value is always cudaMemHandleTypeNone as an imported pool cannot be re-exportedcudaMemPoolAttr::CU_MEMPOOL_ATTR_LOCATION_ID: (value type = int) The location id for the mempool. If the location type for this pool is cudaMemLocationTypeInvisible then ID will be cudaInvalidDeviceId.cudaMemPoolAttr::CU_MEMPOOL_ATTR_LOCATION_TYPE: (value type = cudaMemLocationType) The location type for the mempool. For imported memory pools where the device is not directly visible to the importing process or pools imported via fabric handles across nodes this will be cudaMemlocataionTypeInvisible.cudaMemPoolAttr::CU_MEMPOOL_ATTR_LOCALITY_DOMAIN_ID: (value type = int) The locality domain id for the mempool, if the mempool is localized to a locality domain. A value of -1 indicates that the mempool is not localized to a locality domain.cudaMemPoolAttr::CU_MEMPOOL_ATTR_MAX_POOL_SIZE: (value type = cuuint64_t) Maximum size of the pool in bytes, this value may be higher than what was initially passed to cuMemPoolCreate due to alignment requirements. A value of 0 indicates no maximum size. For cudaMemAllocationTypeManaged and IPC imported pools this value will be system dependent.cudaMemPoolAttr::CU_MEMPOOL_ATTR_HW_DECOMPRESS_ENABLED: (value type = int) Indicates whether the pool has hardware compresssion enabled.
Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback. cudaError_t::CUDA_ERROR_NOT_PERMITTED may, but is not guaranteed to, be returned as a diagnostic in such case.
§Parameters
attr: The attribute to get.value: Retrieved value.
§Return value
See also: cuMemPoolGetAttribute, cudaMallocAsync, cudaFreeAsync, cudaDeviceGetDefaultMemPool, cudaDeviceGetMemPool, cudaMemPoolCreate.