public class MultiBufferDataSource extends DataSource
| Constructor and Description |
|---|
MultiBufferDataSource(HostMemoryAllocator allocator,
HostMemoryBuffer... buffers)
Create a new data source backed by multiple buffers.
|
MultiBufferDataSource(HostMemoryBuffer... buffers)
Create a new data source backed by multiple buffers.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
long |
deviceRead(long offset,
DeviceMemoryBuffer dest,
Cuda.Stream stream)
Read data from the source at the given offset into dest.
|
long |
getDevReadBytes() |
long |
getDevReads() |
long |
getHostReadBytes() |
long |
getHostReads() |
long |
hostRead(long offset,
HostMemoryBuffer dest)
Read data from the source at the given offset into dest.
|
HostMemoryBuffer |
hostRead(long offset,
long amount)
Read data from the source at the given offset.
|
long |
size()
Get the size of the source in bytes.
|
boolean |
supportsDeviceRead()
Return true if this supports reading directly to the device else false.
|
getDeviceReadCutoff, onHostBufferDonepublic MultiBufferDataSource(HostMemoryBuffer... buffers)
buffers - the buffers that will back the data source.public MultiBufferDataSource(HostMemoryAllocator allocator, HostMemoryBuffer... buffers)
allocator - the allocator to use for host buffers, if needed.buffers - the buffers that will back the data source.public long size()
DataSourcesize in class DataSourcepublic HostMemoryBuffer hostRead(long offset, long amount)
DataSourcehostRead in class DataSourceoffset - where to start reading from.amount - the maximum number of bytes to read.public long hostRead(long offset,
HostMemoryBuffer dest)
DataSourcehostRead in class DataSourceoffset - the offset to start reading from in the source.dest - where to write the data.public boolean supportsDeviceRead()
DataSourcesupportsDeviceRead in class DataSourcepublic long deviceRead(long offset,
DeviceMemoryBuffer dest,
Cuda.Stream stream)
DataSourcedeviceRead in class DataSourceoffset - the offset to start reading fromdest - where to write the data.stream - the stream to do the copy on.public void close()
close in interface AutoCloseableclose in class DataSourcepublic long getHostReads()
public long getHostReadBytes()
public long getDevReads()
public long getDevReadBytes()
Copyright © 2024. All rights reserved.