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