FZGPUModules 2.0
GPU-accelerated modular compression pipelines
Loading...
Searching...
No Matches
huffman_stage.h File Reference

Huffman entropy coding stage. More...

#include "stage/stage.h"
#include "fzm_format.h"
#include "coders/huffman/phf/hf.h"
#include "backend/types.h"
#include <cstdint>
#include <cstring>
#include <memory>
#include <stdexcept>
#include <string>
#include <type_traits>
#include <unordered_map>
#include <vector>

Go to the source code of this file.

Classes

struct  fz::HuffmanBookSpec
 
class  fz::HuffmanStage< T >
 

Namespaces

namespace  fz
 

Enumerations

enum class  fz::HuffmanExecutionMode { fz::HostCoordinated , fz::DeviceResident }
 
enum class  fz::HuffmanBookSource { fz::PerBlock , fz::Fixed , fz::Adaptive }
 
enum class  fz::HuffmanBookModel { fz::Gaussian , fz::Laplace , fz::GeneralizedNormal , fz::Uniform }
 

Detailed Description

Huffman entropy coding stage.

Forward: T[] → variable-length cuSZ Huffman bitstream (phf_header prepended). Inverse: cuSZ Huffman bitstream → T[].

Both execution modes use the multi-kernel coarse-grained coder. The default HostCoordinated mode carries a CPU prefix-sum sync in the middle of encode; DeviceResident keeps the partition scan and stream assembly on the GPU for all book sources, including canonical codebook construction from device histograms.

Note: the histogram D2H is a CPU-sync operation. It disappears entirely under HuffmanBookSource::Fixed, which builds the codebook once up front instead of per call; see setBookSource(). The encoded stream is unchanged, so fixed-book output decodes with a stock decoder.

Supported input types: uint8_t, uint16_t, uint32_t.

Serialized header layout (11 bytes): [0] DataType of T (1 byte) [1..2] bklen_ (uint16_t LE) [3..10] original_len_ (uint64_t LE, element count)