Library/ManagedCuda/CudaGraph.cs
/// <summary>
/// Creates a host execution node and adds it to a graph<para/>
/// Creates a new CPU execution node and adds it to the 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/>
/// When the graph is launched, the node will invoke the specified CPU function.
/// </summary>
/// <param name="dependencies">can be null</param>
/// <param name="hostFunction">Host function to execute</param>
/// <param name="userData">User data for host function. Note that the data object must be pinned by GC!</param>
/// <returns>A handle to the new node will be returned.</returns>
Creates a host execution node and adds it to a graph
Creates a new CPU execution node and adds it to the 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.
When the graph is launched, the node will invoke the specified CPU function.
Creates a host execution node and adds it to a graph Creates a new CPU execution node and adds it to the 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 . When the graph is launched the node will invoke the specified CPU function .
public CUgraphNode AddHostNode(CUgraphNode[] dependencies, CUhostFn hostFunction, IntPtr userData)
        {
            CUgraphNode node = new CUgraphNode();
            SizeT numDependencies = 0;
            if (dependencies != null)
                numDependencies = dependencies.Length;
            CUDA_HOST_NODE_PARAMS nodeParams = new CUDA_HOST_NODE_PARAMS
            {
                fn = hostFunction,
                userData = userData
            };
            res = DriverAPINativeMethods.GraphManagment.cuGraphAddHostNode(ref node, _graph, dependencies, numDependencies, ref nodeParams);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuGraphAddHostNode", res));
            if (res != CUResult.Success) throw new CudaException(res);
            return node;
        }
public CUgraphNode AddHostNode ( CUgraphNode [ ] dependencies , CUhostFn hostFunction , IntPtr userData ) { CUgraphNode node = new CUgraphNode ( ) ; SizeT numDependencies = 0 ; if ( dependencies != null ) numDependencies = dependencies . Length ; CUDA_HOST_NODE_PARAMS nodeParams = new CUDA_HOST_NODE_PARAMS { fn = hostFunction , userData = userData } ; res = DriverAPINativeMethods . GraphManagment . cuGraphAddHostNode ( ref node , _graph , dependencies , numDependencies , ref nodeParams ) ; Debug . WriteLine ( String . Format ( " " , DateTime . Now , " " , res ) ) ; if ( res != CUResult . Success ) throw new CudaException ( res ) ; return node ; }
Creates a host execution node and adds it to a graph
Creates a new CPU execution node and adds it to the graph with
dependencies specified via dependencies.
Creates a host execution node and adds it to a graph Creates a new CPU execution node and adds it to the graph with dependencies specified via dependencies .
A handle to the new node will be returned.
A handle to the new node will be returned .
dependencies
CUgraphNode[]
can be null
can be null
hostFunction
CUhostFn
Host function to execute
Host function to execute
userData
IntPtr
User data for host function. Note that the data object must be pinned by GC!
User data for host function . Note that the data object must be pinned by GC!