nvgraphSetVertexData() private method

private nvgraphSetVertexData ( nvgraphContext handle, nvgraphGraphDescr descrG, ManagedCuda.BasicTypes.CUdeviceptr vertexData, ManagedCuda.BasicTypes.SizeT setnum ) : nvgraphStatus
handle nvgraphContext
descrG nvgraphGraphDescr
vertexData ManagedCuda.BasicTypes.CUdeviceptr
setnum ManagedCuda.BasicTypes.SizeT
return nvgraphStatus
Example #1
0
 public void SetVertexData <Type>(CudaDeviceVariable <Type> vertexData, SizeT setnum) where Type : struct
 {
     res = NVGraphNativeMathods.nvgraphSetVertexData(_context, _descr, vertexData.DevicePointer, setnum);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nvgraphSetVertexData", res));
     if (res != nvgraphStatus.Success)
     {
         throw new NVGraphException(res);
     }
 }
Example #2
0
        public void SetVertexData(Array vertexData, SizeT setnum)
        {
            GCHandle handle = GCHandle.Alloc(vertexData, GCHandleType.Pinned);

            try
            {
                res = NVGraphNativeMathods.nvgraphSetVertexData(_context, _descr, handle.AddrOfPinnedObject(), setnum);
                Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nvgraphSetVertexData", res));
                if (res != nvgraphStatus.Success)
                {
                    throw new NVGraphException(res);
                }
            }
            finally
            {
                handle.Free();
            }
        }