Пример #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
        }
Пример #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);