public HuForceDirectedLayout(int steps)
        {
            #if !DEBUG
            try
            {
            #endif
                CUDADriver.cuInit(0);

                dev = new CUdevice();
                CUDADriver.cuDeviceGet(ref dev, 0);

                ctx = new CUcontext();
                CUDADriver.cuCtxCreate(ref ctx, 0, dev);

                mod = new CUmodule();
                CUDADriver.cuModuleLoad(ref mod, "BarnesHut.cubin");

                prop = new CUDeviceProperties();
                CUDADriver.cuDeviceGetProperties(ref prop, dev);
                int version = 0;
                CUDADriver.cuDriverGetVersion(ref version);

                string caps = "";

                GASS.CUDA.CUDARuntime.cudaRuntimeGetVersion(ref version);

                caps += "\tClock rate        = " + prop.clockRate/1000000 + " MHz\n";
                caps += "\tMemory size       = " + prop.totalConstantMemory/1024 + " KB\n";
                caps += "\tThreads per block = " + prop.maxThreadsPerBlock + "\n";
                caps += "\tWarp size         = " + prop.SIMDWidth + "\n";
                caps += "\tCUDA version      = " + version + "\n";

                Logger.AddMessage(LogEntryType.Info, "Successfully initialized CUDA GPU computation\n"+caps);
            #if !DEBUG
            }
            catch(Exception ex)
            {
                Logger.AddMessage(LogEntryType.Warning, "CUDA not available, falling back to CPU. Exception was: " + ex.Message);
                CUDAEnabled = false;
            }
            #endif
        }
示例#2
0
 public static extern CUResult cuWGLGetDevice(ref CUdevice pDevice, IntPtr hGpu);
示例#3
0
 public static extern CUResult cuGLCtxCreate(ref CUcontext pCtx, uint Flags, CUdevice device);
示例#4
0
 public static extern CUResult cuD3D10CtxCreate(ref CUcontext pCtx, ref CUdevice pCuDevice, uint Flags, IntPtr pDxDevice);
示例#5
0
 public static extern CUResult cuD3D10GetDevice(ref CUdevice pDevice, IntPtr pAdapter);
示例#6
0
 public static extern CUResult cuD3D9CtxCreate(ref CUcontext pCtx, ref CUdevice pCuDevice, CUCtxFlags Flags, IntPtr pDxDevice);
示例#7
0
 public static extern CUResult cuD3D9GetDevice(ref CUdevice pDevice, string pszAdapterName);
示例#8
0
 public static extern CUResult cuDeviceGet(ref CUdevice device, int ordinal);
示例#9
0
 public static extern CUResult cuDeviceGetAttribute(ref int pi, CUDeviceAttribute attrib, CUdevice dev);
示例#10
0
 public static extern CUResult cuCtxGetDevice(ref CUdevice device);
示例#11
0
 public static extern CUResult cuDeviceComputeCapability(ref int major, ref int minor, CUdevice dev);
示例#12
0
 public static extern CUResult cuCtxCreate(ref CUcontext pctx, uint flags, CUdevice dev);
示例#13
0
 public static extern CUResult cuDeviceCanAccessPeer(ref int canAccessPeer, CUdevice dev, CUdevice peerDev);
示例#14
0
 public static extern CUResult cuDeviceTotalMem(ref SizeT bytes, CUdevice dev);
示例#15
0
 public static extern CUResult cuDeviceGetProperties(ref CUDeviceProperties prop, CUdevice dev);
示例#16
0
 public static extern CUResult cuDeviceGetName([Out] byte[] name, int len, CUdevice dev);