示例#1
0
        /// <summary> see CUDA doc; </summary>
        public static void CtxCreate(out CUcontext pctx, CUdevice dev, params CUctx_flags_enum[] flags)
        {
            uint _flags = 0;

            foreach (CUctx_flags_enum x in flags)
            {
                _flags |= (uint)x;
            }
            testResult(my.cuCtxCreate(out pctx, _flags, dev));
        }
示例#2
0
        /// <summary>
        /// frees the CUDA context
        /// </summary>
        public void Dispose()
        {
            if (disposed)
            {
                return;
            }

            disposed = true;

            cu.ModuleUnload(CudaMatrixKernelDP);
            CudaMatrixKernelDP           = default(CUmodule);
            CudaMatrixKernelDP_Functions = null;

            cu.ModuleUnload(CudaVectorKernelDP);
            CudaVectorKernelDP           = default(CUmodule);
            CudaVectorKernelDP_Functions = null;

            cu.CtxDestroy(m_context);
            m_context = default(CUcontext);
        }
示例#3
0
 /// <summary> see CUDA doc; </summary>
 public static void CtxDestroy(CUcontext ctx)
 {
     testResult(my.cuCtxDestroy(ctx));
 }