public class CudaMemoryAllocator extends Object implements GPUMemoryAllocator
| Constructor and Description | 
|---|
| CudaMemoryAllocator() | 
| Modifier and Type | Method and Description | 
|---|---|
| void | allocate(jcuda.Pointer devPtr,
        long size)Allocate memory on the device. | 
| boolean | canAllocate(long size)Check if there is enough memory to allocate a pointer of given size | 
| void | free(jcuda.Pointer devPtr)Frees memory on the device | 
| long | getAvailableMemory()Gets the available memory on GPU that SystemDS can use. | 
public void allocate(jcuda.Pointer devPtr,
                     long size)
              throws jcuda.CudaException
allocate in interface GPUMemoryAllocatordevPtr - Pointer to allocated device memorysize - size in bytesjcuda.CudaException - if unable to allocatepublic void free(jcuda.Pointer devPtr)
          throws jcuda.CudaException
free in interface GPUMemoryAllocatordevPtr - Device pointer to memory to freejcuda.CudaException - if error occurspublic boolean canAllocate(long size)
canAllocate in interface GPUMemoryAllocatorsize - size in bytespublic long getAvailableMemory()
getAvailableMemory in interface GPUMemoryAllocatorCopyright © 2021 The Apache Software Foundation. All rights reserved.