Package ai.rapids.cudf
Class BaseDeviceMemoryBuffer
java.lang.Object
ai.rapids.cudf.MemoryBuffer
ai.rapids.cudf.BaseDeviceMemoryBuffer
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
CudaMemoryBuffer
,CuFileBuffer
,DeviceMemoryBuffer
,DeviceMemoryBufferView
Base class for all MemoryBuffers that are in device memory.
-
Nested Class Summary
Nested classes/interfaces inherited from class ai.rapids.cudf.MemoryBuffer
MemoryBuffer.EventHandler, MemoryBuffer.MemoryBufferCleaner
-
Field Summary
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
BaseDeviceMemoryBuffer
(long address, long length, MemoryBuffer parent) protected
BaseDeviceMemoryBuffer
(long address, long length, MemoryBuffer.MemoryBufferCleaner cleaner) -
Method Summary
Modifier and TypeMethodDescriptionfinal 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.final void
copyFromHostBuffer
(long destOffset, HostMemoryBuffer src, long srcOffset, long length) Copy a subset of src to this buffer starting at destOffset.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.final void
Copy everything from src to this buffer starting at the beginning of this buffer.final void
copyFromHostBuffer
(HostMemoryBuffer src, long srcOffset, long length) Copy a subset of src to this buffer starting at the beginning of this.final void
copyFromHostBuffer
(HostMemoryBuffer src, Cuda.Stream stream) Copy entire host buffer starting at the beginning of this buffer using a CUDA stream.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.final void
copyFromHostBufferAsync
(HostMemoryBuffer src, Cuda.Stream stream) Copy entire host buffer starting at the beginning of this buffer using a CUDA stream.final DeviceMemoryBuffer
sliceWithCopy
(long offset, long len) Slice off a part of the device buffer, copying it instead of reference counting it.Methods inherited from class ai.rapids.cudf.MemoryBuffer
addressOutOfBoundsCheck, close, copyFromMemoryBuffer, copyFromMemoryBufferAsync, getAddress, getEventHandler, getLength, getRefCount, incRefCount, noWarnLeakExpected, setEventHandler, slice, toString
-
Constructor Details
-
BaseDeviceMemoryBuffer
-
BaseDeviceMemoryBuffer
protected BaseDeviceMemoryBuffer(long address, long length, MemoryBuffer.MemoryBufferCleaner cleaner)
-
-
Method Details
-
copyFromHostBuffer
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 fromsrcOffset
- offset into src to start outlength
- how many bytes to copy
-
copyFromHostBuffer
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 fromsrcOffset
- offset into src to start outlength
- how many bytes to copystream
- CUDA stream to use
-
copyFromHostBufferAsync
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 fromsrcOffset
- offset into src to start outlength
- how many bytes to copystream
- CUDA stream to use
-
copyFromDeviceBufferAsync
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 fromsrcOffset
- offset into src to start outlength
- how many bytes to copystream
- CUDA stream to use
-
copyFromHostBuffer
Copy a subset of src to this buffer starting at the beginning of this.- Parameters:
src
- what to copy fromsrcOffset
- offset into src to start outlength
- how many bytes to copy
-
copyFromHostBuffer
Copy everything from src to this buffer starting at the beginning of this buffer.- Parameters:
src
- - Buffer to copy data from
-
copyFromHostBuffer
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 fromstream
- CUDA stream to use
-
copyFromHostBufferAsync
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 fromstream
- CUDA stream to use
-
sliceWithCopy
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.
-