pub unsafe extern "C" fn cudaGraphAddMemcpyNode1D(
pGraphNode: *mut cudaGraphNode_t,
graph: cudaGraph_t,
pDependencies: *const cudaGraphNode_t,
numDependencies: size_t,
dst: *mut c_void,
src: *const c_void,
count: size_t,
kind: cudaMemcpyKind,
) -> cudaError_tExpand description
Creates a 1D memcpy node and adds it to a graph.
Creates a new 1D memcpy node and adds it to graph with numDependencies dependencies specified via pDependencies. 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.
When the graph is launched, the node will copy count bytes from the memory area pointed to by src to the memory area pointed to by dst, where kind specifies the direction of the copy, and must be one of cudaMemcpyKind::cudaMemcpyHostToHost, cudaMemcpyKind::cudaMemcpyHostToDevice, cudaMemcpyKind::cudaMemcpyDeviceToHost, cudaMemcpyKind::cudaMemcpyDeviceToDevice, or cudaMemcpyKind::cudaMemcpyDefault. Passing cudaMemcpyKind::cudaMemcpyDefault is recommended, in which case the type of transfer is inferred from the pointer values. However, cudaMemcpyKind::cudaMemcpyDefault is only allowed on systems that support unified virtual addressing. Launching a memcpy node with dst and src pointers that do not match the direction of the copy results in an undefined behavior.
Memcpy nodes have some additional restrictions with regards to managed memory, if the system contains at least one device which has a zero value for the device attribute cudaDeviceAttr::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS.
Note: Graph objects are not threadsafe. More here.
Note that this function may also return error codes from previous, asynchronous launches.
Note that this function may also return cudaError_t::CUDA_ERROR_NOT_INITIALIZED, cudaErrorInsufficientDriver or cudaError_t::CUDA_ERROR_NO_DEVICE if this call tries to initialize internal CUDA RT state.
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
pGraphNode: Returns newly created node.graph: Graph to which to add the node.pDependencies: Dependencies of the node.numDependencies: Number of dependencies.dst: Destination memory address.src: Source memory address.count: Size in bytes to copy.kind: Type of transfer.
§Return value
See also: cudaMemcpy, cudaGraphAddMemcpyNode, cudaGraphMemcpyNodeGetParams, cudaGraphMemcpyNodeSetParams, cudaGraphMemcpyNodeSetParams1D, cudaGraphCreate, cudaGraphDestroyNode, cudaGraphAddChildGraphNode, cudaGraphAddEmptyNode, cudaGraphAddKernelNode, cudaGraphAddHostNode, cudaGraphAddMemsetNode.