pub unsafe extern "C" fn cudaGraphAddMemFreeNode(
pGraphNode: *mut cudaGraphNode_t,
graph: cudaGraph_t,
pDependencies: *const cudaGraphNode_t,
numDependencies: size_t,
dptr: *mut c_void,
) -> cudaError_tExpand description
Creates a memory free node and adds it to a graph.
Creates a new memory free node and adds it to graph with numDependencies dependencies specified via pDependencies and address specified in dptr. It is possible for numDependencies to be 0, in which case the node will be placed at the root of the graph. pDependencies may not have any duplicate entries. A handle to the new node will be returned in pGraphNode.
cudaGraphAddMemFreeNode will return cudaError_t::CUDA_ERROR_INVALID_VALUE if the user attempts to free:
- an allocation twice in the same graph.
- an address that was not returned by an allocation node.
- an invalid address.
The following restrictions apply to graphs which contain allocation and/or memory free nodes:
- Nodes and edges of the graph cannot be deleted.
- The graph can only be used in a child node if the ownership is moved to the parent.
- Only one instantiation of the graph may exist at any point in time.
- The graph cannot be cloned.
Note: Graph objects are not threadsafe. More here.
Note that this function may also return error codes from previous, asynchronous launches.
§Parameters
pGraphNode: Returns newly created node.graph: Graph to which to add the node.pDependencies: Dependencies of the node.numDependencies: Number of dependencies.dptr: Address of memory to free.
§Return value
cudaError_t::CUDA_SUCCESScudaError_t::CUDA_ERROR_DEINITIALIZEDcudaError_t::CUDA_ERROR_NOT_INITIALIZEDcudaError_t::CUDA_ERROR_NOT_SUPPORTED
See also: cudaGraphAddNode, cudaGraphAddMemAllocNode, cudaGraphMemFreeNodeGetParams, cudaDeviceGraphMemTrim, cudaDeviceGetGraphMemAttribute, cudaDeviceSetGraphMemAttribute, cudaMallocAsync, cudaFreeAsync, cudaGraphCreate, cudaGraphDestroyNode, cudaGraphAddChildGraphNode, cudaGraphAddEmptyNode, cudaGraphAddEventRecordNode, cudaGraphAddEventWaitNode, cudaGraphAddExternalSemaphoresSignalNode, cudaGraphAddExternalSemaphoresWaitNode, cudaGraphAddKernelNode, cudaGraphAddMemcpyNode, cudaGraphAddMemsetNode.