BaseDeviceMemoryBuffer#
- public abstract class BaseDeviceMemoryBuffer extends MemoryBuffer#
Base class for all MemoryBuffers that are in device memory.
Subclassed by ai.rapids.cudf.CuFileBuffer, ai.rapids.cudf.CudaMemoryBuffer, ai.rapids.cudf.DeviceMemoryBuffer, ai.rapids.cudf.DeviceMemoryBufferView
Constructor Summary
BaseDeviceMemoryBuffer(long address, long length, MemoryBuffer parent)BaseDeviceMemoryBuffer(long address, long length, MemoryBufferCleaner cleaner)Method Summary
Copy a subset of src to this buffer starting at destOffset using the specified CUDA stream.
Copy everything from src to this buffer starting at the beginning of this buffer.
copyFromHostBuffer(HostMemoryBuffer src, Cuda.Stream stream)Copy entire host buffer starting at the beginning of this buffer using a CUDA stream.
copyFromHostBuffer(HostMemoryBuffer src, long srcOffset, long length)Copy a subset of src to this buffer starting at the beginning of this.
copyFromHostBuffer(long destOffset, HostMemoryBuffer src, long srcOffset, long length)Copy a subset of src to this buffer starting at destOffset.
Copy a subset of src to this buffer starting at destOffset using the specified CUDA stream.
copyFromHostBufferAsync(HostMemoryBuffer src, Cuda.Stream stream)Copy entire host buffer starting at the beginning of this buffer using a CUDA stream.
Copy a subset of src to this buffer starting at destOffset using the specified CUDA stream.
Slice off a part of the device buffer, copying it instead of reference counting it.
Fields inherited from class
ai.rapids.cudf.MemoryBuffer:address,cleaner,closed,id,length,refCountMethods inherited from class
ai.rapids.cudf.MemoryBuffer:addressOutOfBoundsCheck,close,copyFromMemoryBuffer,copyFromMemoryBufferAsync,getAddress,getEventHandler,getLength,getRefCount,incRefCount,noWarnLeakExpected,setEventHandler,slice,toStringMethods
- public final void copyFromHostBuffer(
- long destOffset,
- HostMemoryBuffer src,
- long srcOffset,
- long length
Copy a subset of src to this buffer starting at destOffset.
- Parameters:
destOffset – the offset in this to start copying from.
src – what to copy from
srcOffset – offset into src to start out
length – how many bytes to copy
- public final void copyFromHostBuffer(
- long destOffset,
- HostMemoryBuffer src,
- long srcOffset,
- long length,
- Cuda.Stream stream
Copy a subset of src to this buffer starting at destOffset using the specified CUDA stream.
The copy has completed when this returns, but the memory copy could overlap with operations occurring on other streams.
- Parameters:
destOffset – the offset in this to start copying from.
src – what to copy from
srcOffset – offset into src to start out
length – how many bytes to copy
stream – CUDA stream to use
- public final void copyFromHostBufferAsync(
- long destOffset,
- HostMemoryBuffer src,
- long srcOffset,
- long length,
- Cuda.Stream stream
Copy a subset of src to this buffer starting at destOffset using the specified CUDA stream.
The copy is async and may not have completed when this returns.
- Parameters:
destOffset – the offset in this to start copying from.
src – what to copy from
srcOffset – offset into src to start out
length – how many bytes to copy
stream – CUDA stream to use
- public final void copyFromDeviceBufferAsync(
- long destOffset,
- BaseDeviceMemoryBuffer src,
- long srcOffset,
- long length,
- Cuda.Stream stream
Copy a subset of src to this buffer starting at destOffset using the specified CUDA stream.
The copy is async and may not have completed when this returns.
- Parameters:
destOffset – the offset in this to start copying from.
src – what to copy from
srcOffset – offset into src to start out
length – how many bytes to copy
stream – CUDA stream to use
- public final void copyFromHostBuffer(
- HostMemoryBuffer src,
- long srcOffset,
- long length
Copy a subset of src to this buffer starting at the beginning of this.
- Parameters:
src – what to copy from
srcOffset – offset into src to start out
length – how many bytes to copy
- public final void copyFromHostBuffer(HostMemoryBuffer src)#
Copy everything from src to this buffer starting at the beginning of this buffer.
- Parameters:
src – - Buffer to copy data from
- public final void copyFromHostBuffer(
- HostMemoryBuffer src,
- Cuda.Stream stream
Copy entire host buffer starting at the beginning of this buffer using a CUDA stream.
The copy has completed when this returns, but the memory copy could overlap with operations occurring on other streams.
- Parameters:
src – host buffer to copy from
stream – CUDA stream to use
- public final void copyFromHostBufferAsync(
- HostMemoryBuffer src,
- Cuda.Stream stream
Copy entire host buffer starting at the beginning of this buffer using a CUDA stream.
The copy is async and may not have completed when this returns.
- Parameters:
src – host buffer to copy from
stream – CUDA stream to use
- public final DeviceMemoryBuffer sliceWithCopy(long offset, long len)#
Slice off a part of the device buffer, copying it instead of reference counting it.
- Parameters:
offset – where to start the slice at.
len – how many bytes to slice
- Returns:
a device buffer that will need to be closed independently from this buffer.
Protected Constructors
- protected BaseDeviceMemoryBuffer(
- long address,
- long length,
- MemoryBuffer parent
- protected BaseDeviceMemoryBuffer(
- long address,
- long length,
- MemoryBufferCleaner cleaner