|
FZGPUModules 2.0
GPU-accelerated modular compression pipelines
|
#include <zigzag.h>
Static Public Member Functions | |
| static FZ_HOST_DEVICE constexpr UInt | encode (SInt x) noexcept |
| static FZ_HOST_DEVICE constexpr SInt | decode (UInt u) noexcept |
Zigzag (two's-complement to magnitude-sign) encoding helper.
Maps signed integers to unsigned integers such that small-magnitude values (positive and negative) produce small non-negative codes — ideal before entropy coding or bitshuffle. Encode and decode are both O(1) bitwise ops.
All functions are __host__ __device__ — callable from CUDA kernels and host code. Used internally by ZigzagStage<TIn, TOut>.
| T | Signed integer type (int8_t, int16_t, int32_t, int64_t). |
|
inlinestaticconstexprnoexcept |
Zigzag encode: signed integer → unsigned integer.
Small-magnitude signed values map to small unsigned values: 0 → 0, -1 → 1, 1 → 2, -2 → 3, 2 → 4, …
|
inlinestaticconstexprnoexcept |