cuda.bindings._v2.driver.mem_get_mem_pool#

cuda.bindings._v2.driver.mem_get_mem_pool(location, int type) → intptr_t#

Gets the current memory pool for a memory location and of a particular allocation type.

The memory location can be of one of CU_MEM_LOCATION_TYPE_DEVICE, CU_MEM_LOCATION_TYPE_HOST or CU_MEM_LOCATION_TYPE_HOST_NUMA, CU_MEM_LOCATION_TYPE_HOST_NUMA, or CU_MEM_LOCATION_TYPE_DEVICE_LOCALITY_DOMAIN. The allocation type can be one of CU_MEM_ALLOCATION_TYPE_PINNED or CU_MEM_ALLOCATION_TYPE_MANAGED. When the allocation type is CU_MEM_ALLOCATION_TYPE_MANAGED, the location type can also be CU_MEM_LOCATION_TYPE_NONE to indicate no preferred location for the managed memory pool. CU_MEM_ALLOCATION_TYPE_MANAGED can not be used with CU_MEM_LOCATION_TYPE_DEVICE_LOCALITY_DOMAIN. In all other cases, the call returns CUDA_ERROR_INVALID_VALUE. Returns the last pool provided to cuMemSetMemPool or cuDeviceSetMemPool for this location and allocation type or the location’s default memory pool if cuMemSetMemPool or cuDeviceSetMemPool for that allocType and location has never been called. By default the current mempool of a location is the default mempool for a device. Otherwise the returned pool must have been set with cuDeviceSetMemPool.

Parameters:
  • location (intptr_t) – Memory location for which to query the current memory pool.

  • type (MemAllocationType) – Allocation type for which to query the current memory pool.

Returns:

Returned current memory pool for the given location and

allocation type.

Return type:

intptr_t

See also

cuMemGetMemPool