/// <summary>
 /// Sets the parameters for an external semaphore wait node in the given graphExec<para/>
 /// Sets the parameters of an external semaphore wait node in an executable graph \p hGraphExec.<para/>
 /// The node is identified by the corresponding node \p hNode in the
 /// non-executable graph, from which the executable graph was instantiated.<para/>
 /// hNode must not have been removed from the original graph.<para/>
 /// The modifications only affect future launches of \p hGraphExec. Already
 /// enqueued or running launches of \p hGraphExec are not affected by this call.
 /// hNode is also not modified by this call.<para/>
 /// Changing \p nodeParams->numExtSems is not supported.
 /// </summary>
 public void SetParams(CUgraphNode hNode, CudaExtSemWaitNodeParams nodeParams)
 {
     res = DriverAPINativeMethods.GraphManagment.cuGraphExecExternalSemaphoresWaitNodeSetParams(_graph, hNode, nodeParams);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuGraphExecExternalSemaphoresWaitNodeSetParams", res));
     if (res != CUResult.Success)
     {
         throw new CudaException(res);
     }
 }
Beispiel #2
0
        /// <summary>
        /// Creates an external semaphore wait node and adds it to a graph<para/>
        /// Creates a new external semaphore wait node and adds it to \p hGraph with \p numDependencies
        /// dependencies specified via \p dependencies and arguments specified in \p nodeParams.
        /// It is possible for \p numDependencies to be 0, in which case the node will be placed
        /// at the root of the graph. \p dependencies may not have any duplicate entries. A handle
        /// to the new node will be returned in \p phGraphNode.
        /// </summary>
        /// <param name="dependencies">Dependencies of the node</param>
        /// <param name="nodeParams">Parameters for the node</param>
        /// <returns>Returns newly created node</returns>
        public CUgraphNode AddExternalSemaphoresWaitNode(CUgraphNode[] dependencies, CudaExtSemWaitNodeParams nodeParams)
        {
            CUgraphNode node            = new CUgraphNode();
            SizeT       numDependencies = 0;

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

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

            return(node);
        }