Example #1
0
        /// <summary> see CUDA doc; </summary>
        public static void ModuleLoad(out CUmodule module, string fname)
        {
            IntPtr   _fname = Marshal.StringToHGlobalAnsi(fname);
            CUresult res    = my.cuModuleLoad(out module, _fname);

            Marshal.FreeHGlobal(_fname);
            testResult(res);
        }
Example #2
0
        /// <summary> see CUDA doc; </summary>
        public static void ModuleGetFunction(out CUfunction func, CUmodule module, string name)
        {
            //IntPtr _name = Marshal.StringToHGlobalAnsi(name);
            IntPtr   _name = Marshal.StringToHGlobalAnsi(name);
            CUresult res   = my.cuModuleGetFunction(out func, module, _name);

            //Marshal.FreeHGlobal(_name);
            Marshal.FreeHGlobal(_name);
            testResult(res);
        }
Example #3
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);
        }
Example #4
0
        /// <summary> see CUDA doc; </summary>
        public static void ModuleLoadData(out CUmodule module, IntPtr img)
        {
            CUresult res = my.cuModuleLoadData(out module, img);

            testResult(res);
        }
Example #5
0
 /// <summary> see CUDA doc; </summary>
 public static void ModuleUnload(CUmodule module)
 {
     testResult(my.cuModuleUnload(module));
 }