Library/ManagedCuda/CudaGraph.cs
/// <summary>
/// Creates a kernel execution node and adds it to a graph<para/>
/// Creates a new kernel execution node and adds it to the graph with
/// dependencies specified via dependencies and arguments specified in nodeParams.<para/>
/// 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.<para/>
/// A handle to the new node will be returned.
/// </summary>
/// <param name="dependencies">can be null</param>
/// <param name="kernel">Kernel to execute</param>
/// <param name="parameters">Kernel parameters to pass. An Array of IntPtr each of them pointing to a parameters. Note that the parameters must be pinned by GC!</param>
/// <param name="extras">Extra data</param>
/// <returns>A handle to the new node will be returned.</returns>
Creates a kernel execution node and adds it to a graph
Creates a new kernel execution node and adds it to the graph with
dependencies specified via dependencies and arguments specified in nodeParams.
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.
Creates a kernel execution node and adds it to a graph Creates a new kernel execution node and adds it to the graph with dependencies specified via dependencies and arguments specified in nodeParams . 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 .
public CUgraphNode AddKernelNode(CUgraphNode[] dependencies, CudaKernel kernel, IntPtr parameters, IntPtr extras)
        {
            CUgraphNode node = new CUgraphNode();
            SizeT numDependencies = 0;
            if (dependencies != null)
                numDependencies = dependencies.Length;
            CUDA_KERNEL_NODE_PARAMS nodeParams = new CUDA_KERNEL_NODE_PARAMS
            {
                blockDimX = kernel.BlockDimensions.x,
                blockDimY = kernel.BlockDimensions.y,
                blockDimZ = kernel.BlockDimensions.z,
                extra = extras,
                func = kernel.CUFunction,
                gridDimX = kernel.GridDimensions.x,
                gridDimY = kernel.GridDimensions.y,
                gridDimZ = kernel.GridDimensions.z,
                kernelParams = parameters,
                sharedMemBytes = kernel.DynamicSharedMemory
            };
            res = DriverAPINativeMethods.GraphManagment.cuGraphAddKernelNode(ref node, _graph, dependencies, numDependencies, ref nodeParams);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuGraphAddKernelNode", res));
            if (res != CUResult.Success) throw new CudaException(res);
            return node;
        }
public CUgraphNode AddKernelNode ( CUgraphNode [ ] dependencies , CudaKernel kernel , IntPtr parameters , IntPtr extras ) { CUgraphNode node = new CUgraphNode ( ) ; SizeT numDependencies = 0 ; if ( dependencies != null ) numDependencies = dependencies . Length ; CUDA_KERNEL_NODE_PARAMS nodeParams = new CUDA_KERNEL_NODE_PARAMS { blockDimX = kernel . BlockDimensions . x , blockDimY = kernel . BlockDimensions . y , blockDimZ = kernel . BlockDimensions . z , extra = extras , func = kernel . CUFunction , gridDimX = kernel . GridDimensions . x , gridDimY = kernel . GridDimensions . y , gridDimZ = kernel . GridDimensions . z , kernelParams = parameters , sharedMemBytes = kernel . DynamicSharedMemory } ; res = DriverAPINativeMethods . GraphManagment . cuGraphAddKernelNode ( 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 kernel execution node and adds it to a graph
Creates a new kernel execution node and adds it to the graph with
dependencies specified via dependencies and arguments specified in nodeParams.
Creates a kernel execution node and adds it to a graph Creates a new kernel execution node and adds it to the graph with dependencies specified via dependencies and arguments specified in nodeParams .
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
kernel
CudaKernel
Kernel to execute
Kernel to execute
parameters
IntPtr
Kernel parameters to pass. An Array of IntPtr each of them pointing to a parameters. Note that the parameters must be pinned by GC!
Kernel parameters to pass . An Array of IntPtr each of them pointing to a parameters . Note that the parameters must be pinned by GC!
extras
IntPtr
None