Class GPULazyCudaFreeMemoryManager


  • public class GPULazyCudaFreeMemoryManager
    extends Object
    • Constructor Detail

      • GPULazyCudaFreeMemoryManager

        public GPULazyCudaFreeMemoryManager​(GPUMemoryManager gpuManager)
    • Method Detail

      • getRmvarPointer

        public jcuda.Pointer getRmvarPointer​(String opcode,
                                             long size)
        Get any pointer of the given size from rmvar-ed pointers (applicable if eager cudaFree is set to false)
        Parameters:
        opcode - opcode
        size - size in bytes
        Returns:
        pointer
      • getAllPointers

        public Set<jcuda.Pointer> getAllPointers()
      • clearAll

        public void clearAll()
      • getTotalMemoryAllocated

        public long getTotalMemoryAllocated()
        Return the total memory in bytes used by this memory manager
        Returns:
        number of bytes
      • getNumPointers

        public int getNumPointers()
        Get total number of rmvared pointers
        Returns:
        number of pointers
      • add

        public void add​(long size,
                        jcuda.Pointer toFree)
        Add a pointer to the rmvar-ed list
        Parameters:
        size - size of the pointer
        toFree - pointer
      • removeIfPresent

        public void removeIfPresent​(long size,
                                    jcuda.Pointer ptr)
        Remove a specific pointer if present in the internal hashmap
        Parameters:
        size - size in bytes
        ptr - pointer to be removed