Skip to main content

cuGraphAddMemcpyNode

Function cuGraphAddMemcpyNode 

Source
pub unsafe extern "C" fn cuGraphAddMemcpyNode(
    phGraphNode: *mut CUgraphNode,
    hGraph: CUgraph,
    dependencies: *const CUgraphNode,
    numDependencies: size_t,
    copyParams: *const CUDA_MEMCPY3D,
    ctx: CUcontext,
) -> CUresult
Expand description

Creates a memcpy node and adds it to a graph.

Creates a new memcpy node and adds it to hGraph with numDependencies dependencies specified via dependencies. It is possible for numDependencies to be 0, in which case the node will be placed at the root of the graph. dependencies may not have any duplicate entries. A handle to the new node will be returned in phGraphNode.

When the graph is launched, the node will perform the memcpy described by copyParams. See cuMemcpy3D() for a description of the structure and its restrictions.

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 CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS. If one or more of the operands refer to managed memory, then using the memory type CUmemorytype_enum::CU_MEMORYTYPE_UNIFIED is disallowed for those operand(s). The managed memory will be treated as residing on either the host or the device, depending on which memory type is specified.

Note: Graph objects are not threadsafe. More here.

Note that this function may also return error codes from previous, asynchronous launches.

§Parameters

  • phGraphNode: Returns newly created node.
  • hGraph: Graph to which to add the node.
  • dependencies: Dependencies of the node.
  • numDependencies: Number of dependencies.
  • copyParams: Parameters for the memory copy.
  • ctx: Context on which to run the node.

§Return value

See also: cuGraphAddNode, cuMemcpy3D, cuGraphMemcpyNodeGetParams, cuGraphMemcpyNodeSetParams, cuGraphCreate, cuGraphDestroyNode, cuGraphAddChildGraphNode, cuGraphAddEmptyNode, cuGraphAddKernelNode, cuGraphAddHostNode, cuGraphAddMemsetNode.