Пример #1
0
        private void InitializeCUDA()
        {
            context = new CudaContext(CudaContext.GetMaxGflopsDevice(), graphicsDevice.ComPointer, CUCtxFlags.SchedAuto, CudaContext.DirectXVersion.D3D11);

            module = context.LoadModulePTX(@"Kernels\kernel.ptx");

            kernelPositionWeightNoiseCube     = new CudaKernel("position_weight_noise_cube", module, context);
            kernelNormalAmbient               = new CudaKernel("normal_ambient", module, context);
            kernelMarchingCubesCases          = new CudaKernel("marching_cubes_cases", module, context);
            kernelMarchingCubesVertices       = new CudaKernel("marching_cubes_vertices", module, context);
            kernelPositionWeightNoiseCubeWarp = new CudaKernel("position_weight_noise_cube_warp", module, context);
            kernelPositionWeightFormula       = new CudaKernel("position_weight_formula", module, context);

            prefixScan = new CUDAPrefixScan(module, context);
        }