Skip to main content

cudaMemSetMemPool

Function cudaMemSetMemPool 

Source
pub unsafe extern "C" fn cudaMemSetMemPool(
    location: *mut cudaMemLocation,
    type_: cudaMemAllocationType,
    memPool: cudaMemPool_t,
) -> cudaError_t
Expand description

Sets the current memory pool for a memory location and allocation type.

The memory location can be of one of cudaMemLocationTypeDevice, cudaMemLocationTypeHost cudaMemLocationTypeHostNuma, or cudaMemLocationTypeDeviceLocalityDomain. The allocation type can be one of cudaMemAllocationType::cudaMemAllocationTypePinned or cudaMemAllocationType::cudaMemAllocationTypeManaged. When the allocation type is cudaMemAllocationType::cudaMemAllocationTypeManaged, the location type can also be cudaMemLocationTypeNone to indicate no preferred location for the managed memory pool. cudaMemAllocationType::cudaMemAllocationTypeManaged can not be used with cudaMemLocationTypeDeviceLocalityDomain. In all other cases, the call return cudaErrorInvalidValue

When a memory pool is set as the current memory pool, the location parameter should be the same as the location of the pool. If the location type or index don’t match, the call returns cudaErrorInvalidValue. The type of memory pool should also match the parameter allocType. Else the call returns cudaErrorInvalidValue

.

By default, a memory location’s current memory pool is its default memory pool. If the location type is.