Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 5
0
 /// <summary> see CUDA doc; </summary>
 public static void ModuleUnload(CUmodule module)
 {
     testResult(my.cuModuleUnload(module));
 }