LZ4 Examples#

Location

Description

02_lz4_gpu/lz4_gpu_compression_decompression.cu

Warp-level GPU LZ4 compression and decompression

03_lz4_gpu_and_cpu/lz4_cpu_compression_gpu_decompression.cu

CPU compression with Warp-level GPU LZ4 decompression

03_lz4_gpu_and_cpu/lz4_gpu_compression_cpu_decompression.cu

Warp-level GPU LZ4 compression with CPU decompression

The LZ4 examples, available in the example/nvcompdx/02_lz4_gpu and example/nvcompdx/03_lz4_gpu_and_cpu folders of the nvCOMPDx package, demonstrate how to use nvCOMPDx with LZ4 compression.

The folder example/nvcompdx/02_lz4_gpu contains an example similar to ANS Examples, where user-provided input data is chunked up, followed by round-trip compression and decompression. Unlike the ANS example, this one uses the warp-level API with multiple chunks per thread block. The compression and decompression sides can freely choose the number of chunks processed per thread block. Alternatively, one could also use nvCOMP’s low-level API to perform one side of the operation.

The second folder example/nvcompdx/03_lz4_gpu_and_cpu contains examples that showcase the interoperability of nvCOMPDx with a third-party CPU LZ4 compressor and decompressor implementation (lz4). In the example lz4_cpu_compression_gpu_decompression.cu, the CPU library handles the compression part, and nvCOMPDx executes the decompression tasks. Similarly, in the example lz4_gpu_compression_cpu_decompression.cu, nvCOMPDx performs the compression, and the CPU library decompresses the provided chunks. This CPU library must be separately installed on the system to build the example. Detailed installation instructions are provided on the GitHub example page.