Function rcudnn::cudaMemPoolSetAttribute[][src]

pub unsafe extern "C" fn cudaMemPoolSetAttribute(
    memPool: *mut CUmemPoolHandle_st,
    attr: cudaMemPoolAttr,
    value: *mut c_void
) -> cudaError
Expand description

\brief Sets attributes of a memory pool

Supported attributes are:

  • ::cudaMemPoolAttrReleaseThreshold: (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)
  • ::cudaMemPoolReuseFollowEventDependencies: (value type = int) Allow ::cudaMallocAsync to 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)
  • ::cudaMemPoolReuseAllowOpportunistic: (value type = int) Allow reuse of already completed frees when there is no dependency between the free and allocation. (default enabled)
  • ::cudaMemPoolReuseAllowInternalDependencies: (value type = int) Allow ::cudaMallocAsync to insert new stream dependencies in order to establish the stream ordering required to reuse a piece of memory released by ::cudaFreeAsync (default enabled).

\param[in] pool - The memory pool to modify \param[in] attr - The attribute to modify \param[in] value - Pointer to the value to assign

\returns ::cudaSuccess, ::cudaErrorInvalidValue \note_callback

\sa ::cuMemPoolSetAttribute, ::cudaMallocAsync, ::cudaFreeAsync, ::cudaDeviceGetDefaultMemPool, ::cudaDeviceGetMemPool, ::cudaMemPoolCreate