protected virtual void Dispose(bool disposing) { if (disposed) { return; } // Free unmanaged objects. if (_p != IntPtr.Zero) { Check(NativeMethods.cusolverSpDestroy(_p)); _p = IntPtr.Zero; } if (_buffer != IntPtr.Zero) { Cuda.Free(_buffer); } if (d_x != IntPtr.Zero) { Cuda.Free(d_x); } if (d_b != IntPtr.Zero) { Cuda.Free(d_b); } disposed = true; }
protected void Dispose(bool disposing) { if (disposed) { return; } // Free unmanaged objects. if (_p != IntPtr.Zero) { Check(NativeMethods.cusparseDestroy(_p)); _p = IntPtr.Zero; } if (_matDescr != IntPtr.Zero) { Check(NativeMethods.cusparseDestroyMatDescr(_matDescr)); _matDescr = IntPtr.Zero; } if (d_ap != IntPtr.Zero) { Cuda.Free(d_ap); } if (d_ai != IntPtr.Zero) { Cuda.Free(d_ai); } if (d_ax != IntPtr.Zero) { Cuda.Free(d_ax); } disposed = true; }