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
        }
Esempio n. 2
0
 public static extern CUResult cuWGLGetDevice(ref CUdevice pDevice, IntPtr hGpu);
Esempio n. 3
0
 public static extern CUResult cuGLCtxCreate(ref CUcontext pCtx, uint Flags, CUdevice device);
Esempio n. 4
0
 public static extern CUResult cuD3D10CtxCreate(ref CUcontext pCtx, ref CUdevice pCuDevice, uint Flags, IntPtr pDxDevice);
Esempio n. 5
0
 public static extern CUResult cuD3D10GetDevice(ref CUdevice pDevice, IntPtr pAdapter);
Esempio n. 6
0
 public static extern CUResult cuD3D9CtxCreate(ref CUcontext pCtx, ref CUdevice pCuDevice, CUCtxFlags Flags, IntPtr pDxDevice);
Esempio n. 7
0
 public static extern CUResult cuD3D9GetDevice(ref CUdevice pDevice, string pszAdapterName);
Esempio n. 8
0
 public static extern CUResult cuDeviceGet(ref CUdevice device, int ordinal);
Esempio n. 9
0
 public static extern CUResult cuDeviceGetAttribute(ref int pi, CUDeviceAttribute attrib, CUdevice dev);
Esempio n. 10
0
 public static extern CUResult cuCtxGetDevice(ref CUdevice device);
Esempio n. 11
0
 public static extern CUResult cuDeviceComputeCapability(ref int major, ref int minor, CUdevice dev);
Esempio n. 12
0
 public static extern CUResult cuCtxCreate(ref CUcontext pctx, uint flags, CUdevice dev);
Esempio n. 13
0
 public static extern CUResult cuDeviceCanAccessPeer(ref int canAccessPeer, CUdevice dev, CUdevice peerDev);
Esempio n. 14
0
 public static extern CUResult cuDeviceTotalMem(ref SizeT bytes, CUdevice dev);
Esempio n. 15
0
 public static extern CUResult cuDeviceGetProperties(ref CUDeviceProperties prop, CUdevice dev);
Esempio n. 16
0
 public static extern CUResult cuDeviceGetName([Out] byte[] name, int len, CUdevice dev);