/// <summary>
 /// Updates node parameters in the child graph node in the given graphExec.
 /// Updates the work represented by \p hNode in \p hGraphExec as though the nodes contained
 /// in \p hNode's graph had the parameters contained in \p childGraph's nodes at instantiation.
 /// \p hNode must remain in the graph which was used to instantiate \p hGraphExec.
 /// Changed edges to and from \p hNode are ignored.
 /// The modifications only affect future launches of \p hGraphExec.  Already enqueued
 /// or running launches of \p hGraphExec are not affected by this call.  \p hNode is also
 /// not modified by this call.
 /// The topology of \p childGraph, as well as the node insertion order, must match that
 /// of the graph contained in \p hNode.  See::cuGraphExecUpdate() for a list of restrictions
 /// on what can be updated in an instantiated graph.The update is recursive, so child graph
 /// nodes contained within the top level child graph will also be updated.
 /// </summary>
 public void SetParams(CUgraphNode hNode, CudaGraph childGraph)
 {
     res = DriverAPINativeMethods.GraphManagment.cuGraphExecChildGraphNodeSetParams(_graph, hNode, childGraph.Graph);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuGraphExecChildGraphNodeSetParams", res));
     if (res != CUResult.Success)
     {
         throw new CudaException(res);
     }
 }
Beispiel #2
0
        /// <summary>
        /// Creates a child graph node and adds it to a graph<para/>
        /// Creates a new node which executes an embedded graph, and adds it to this Graph with
        /// dependencies specified via dependencies.
        /// It is possible for dependencies to be null, 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.<para/>
        /// The node executes an embedded child graph. The child graph is cloned in this call.
        /// </summary>
        /// <param name="dependencies">can be null</param>
        /// <param name="childGraph"></param>
        /// <returns>A handle to the new node will be returned.</returns>
        public CUgraphNode AddChildGraphNode(CUgraphNode[] dependencies, CudaGraph childGraph)
        {
            CUgraphNode node            = new CUgraphNode();
            SizeT       numDependencies = 0;

            if (dependencies != null)
            {
                numDependencies = dependencies.Length;
            }

            res = DriverAPINativeMethods.GraphManagment.cuGraphAddChildGraphNode(ref node, _graph, dependencies, numDependencies, childGraph.Graph);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuGraphAddChildGraphNode", res));
            if (res != CUResult.Success)
            {
                throw new CudaException(res);
            }

            return(node);
        }