/// <summary>
 /// Releases any memory used by this buffer, and sets it to null. This method may be
 /// called on a null pointer, but will have no effect.
 /// </summary>
 /// <param name="ptr">A pointer to the buffer to deallocate</param>
 public static void Free(ref IntPtr ptr)
 {
     if (ptr != IntPtr.Zero)
     {
         CudaUtil.Call(CudaMem.cuMemFreeHost(ptr));
         ptr = IntPtr.Zero;
     }
 }
Exemple #2
0
 /// <summary>
 /// Releases any memory used by this buffer. This method may be called on a null
 /// buffer, but will have no effect.
 /// </summary>
 public void Free()
 {
     if (ptr != IntPtr.Zero)
     {
         CudaUtil.Call(CudaMem.cuMemFreeHost(ptr));
         ptr    = IntPtr.Zero;
         length = 0;
     }
 }
Exemple #3
0
 /// <summary>
 /// Releases any memory used by this buffer. This method may be called on a null
 /// buffer, but will have no effect.
 /// </summary>
 public void Free()
 {
     if (ptr != IntPtr.Zero)
     {
         CudaMem.cuMemFreeHost(ptr);
         ptr    = IntPtr.Zero;
         width  = 0;
         height = 0;
     }
 }