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, onHostBufferDone
public 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()
DataSource
size
in class DataSource
public HostMemoryBuffer hostRead(long offset, long amount)
DataSource
hostRead
in class DataSource
offset
- where to start reading from.amount
- the maximum number of bytes to read.public long hostRead(long offset, HostMemoryBuffer dest)
DataSource
hostRead
in class DataSource
offset
- the offset to start reading from in the source.dest
- where to write the data.public boolean supportsDeviceRead()
DataSource
supportsDeviceRead
in class DataSource
public long deviceRead(long offset, DeviceMemoryBuffer dest, Cuda.Stream stream)
DataSource
deviceRead
in class DataSource
offset
- 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 AutoCloseable
close
in class DataSource
public long getHostReads()
public long getHostReadBytes()
public long getDevReads()
public long getDevReadBytes()
Copyright © 2024. All rights reserved.