/// <summary> /// Creates a new CudaGraph /// </summary> public CudaGraph() { _graph = new CUgraph(); res = DriverAPINativeMethods.GraphManagment.cuGraphCreate(ref _graph, 0); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuGraphCreate", res)); if (res != CUResult.Success) { throw new CudaException(res); } }
/// <summary> /// Clones a graph<para/> /// This function creates a copy of the original Graph. /// All parameters are copied into the cloned graph. The original graph may be modified /// after this call without affecting the clone.<para/> /// Child graph nodes in the original graph are recursively copied into the clone. /// </summary> public CudaGraph Clone() { CUgraph clone = new CUgraph(); res = DriverAPINativeMethods.GraphManagment.cuGraphClone(ref clone, _graph); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuGraphClone", res)); if (res != CUResult.Success) { throw new CudaException(res); } return(new CudaGraph(clone)); }
/// <summary> /// For clone graph method /// </summary> internal CudaGraph(CUgraph graph) { _graph = graph; }