Ejemplo n.º 1
0
        /// <summary>
        /// Creates an executable graph from a graph<para/>
        /// Instantiates \p hGraph as an executable graph. The graph is validated for any
        /// structural constraints or intra-node constraints which were not previously
        /// validated.If instantiation is successful, a handle to the instantiated graph
        /// is returned in \p phGraphExec.
        /// </summary>
        public CudaGraphExec Instantiate(CUgraphInstantiate_flags flags)
        {
            CUgraphExec graphExec = new CUgraphExec();

            res = DriverAPINativeMethods.GraphManagment.cuGraphInstantiateWithFlags(ref graphExec, _graph, flags);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuGraphInstantiateWithFlags", res));
            if (res != CUResult.Success)
            {
                throw new CudaException(res);
            }
            return(new CudaGraphExec(graphExec));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates an executable graph from a graph<para/>
        /// Instantiates this Graph as an executable graph. The graph is validated for any
        /// structural constraints or intra-node constraints which were not previously
        /// validated. If instantiation is successful, a handle to the instantiated graph
        /// is returned.
        /// </summary>
        public CudaGraphExec Instantiate()
        {
            SizeT sizeBuffer = 10000;

            byte[]      logBuffer = new byte[sizeBuffer];
            CUgraphExec graphExec = new CUgraphExec();
            CUgraphNode errNode   = new CUgraphNode();

            res = DriverAPINativeMethods.GraphManagment.cuGraphInstantiate(ref graphExec, _graph, ref errNode, logBuffer, sizeBuffer);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuGraphInstantiate", res));
            if (res != CUResult.Success)
            {
                string message = Encoding.ASCII.GetString(logBuffer);
                throw new CudaException(res, message, null);
            }
            return(new CudaGraphExec(graphExec));
        }
Ejemplo n.º 3
0
 /// <summary>
 /// For clone graph method
 /// </summary>
 internal CudaGraphExec(CUgraphExec graph)
 {
     _graph = graph;
 }