public abstract class BatchedCompressor extends Object
Constructor and Description |
---|
BatchedCompressor(long chunkSize,
long maxOutputChunkSize,
long maxIntermediateBufferSize)
Construct a batched compressor instance
|
Modifier and Type | Method and Description |
---|---|
protected abstract void |
batchedCompressAsync(long devInPtrs,
long devInSizes,
long chunkSize,
long batchSize,
long tempPtr,
long tempSize,
long devOutPtrs,
long compressedSizesOutPtr,
long stream)
Asynchronously compress a batch of buffers.
|
protected abstract long |
batchedCompressGetTempSize(long batchSize,
long maxChunkSize)
Get the temporary workspace size required to perform compression of an entire batch.
|
DeviceMemoryBuffer[] |
compress(BaseDeviceMemoryBuffer[] origInputs,
Cuda.Stream stream)
Compress a batch of buffers.
|
public BatchedCompressor(long chunkSize, long maxOutputChunkSize, long maxIntermediateBufferSize)
chunkSize
- maximum amount of uncompressed data to compress as a single chunk.
Inputs larger than this will be compressed in multiple chunks.maxIntermediateBufferSize
- desired maximum size of intermediate device
buffers used during compression.public DeviceMemoryBuffer[] compress(BaseDeviceMemoryBuffer[] origInputs, Cuda.Stream stream)
origInputs
- buffers to compressstream
- CUDA stream to useprotected abstract long batchedCompressGetTempSize(long batchSize, long maxChunkSize)
batchSize
- number of chunks in the batchmaxChunkSize
- maximum size of an uncompressed chunk in bytesprotected abstract void batchedCompressAsync(long devInPtrs, long devInSizes, long chunkSize, long batchSize, long tempPtr, long tempSize, long devOutPtrs, long compressedSizesOutPtr, long stream)
devInPtrs
- device address of uncompressed buffer addresses vectordevInSizes
- device address of uncompressed buffer sizes vectorchunkSize
- maximum size of an uncompressed chunk in bytesbatchSize
- number of chunks in the batchtempPtr
- device address of the temporary workspace buffertempSize
- size of the temporary workspace buffer in bytesdevOutPtrs
- device address of output buffer addresses vectorcompressedSizesOutPtr
- device address where to write the sizes of the
compressed data written to the corresponding
output buffers. Must point to a buffer with
at least 8 bytes of memory per output buffer
in the batch.stream
- CUDA stream to useCopyright © 2024. All rights reserved.