|
FZGPUModules 2.0
GPU-accelerated modular compression pipelines
|
Central registry that reconstructs a Stage from a serialized FZM header. More...
Go to the source code of this file.
Classes | |
| struct | fz::detail::StageFactoryRegistrar |
Namespaces | |
| namespace | fz |
Macros | |
| #define | FZ_REGISTER_STAGE_FACTORY(TYPE, FN) |
| #define | FZ_REGISTER_SIMPLE_STAGE(TYPE, STAGE_CLASS) |
Typedefs | |
| using | fz::StageHeaderFactory = Stage *(*)(const uint8_t *config, size_t config_size) |
Functions | |
| void | fz::registerStageHeaderFactory (StageType type, StageHeaderFactory fn) |
| bool | fz::hasStageHeaderFactory (StageType type) |
| Stage * | fz::createStage (StageType type, const uint8_t *config, size_t config_size) |
Central registry that reconstructs a Stage from a serialized FZM header.
Stages self-register their reconstruction function at static-init time via FZ_REGISTER_STAGE_FACTORY / FZ_REGISTER_SIMPLE_STAGE (placed at file scope in the stage's own .cu). The decompressor calls createStage(), which looks the StageType up in the registry — there is no central switch to edit when a new stage is added.
Adding a stage therefore touches only the stage's own directory for this axis; see docs/how_to_add_a_stage.md.
| #define FZ_REGISTER_STAGE_FACTORY | ( | TYPE, | |
| FN | |||
| ) |
Register a custom header factory for a StageType. Place at file scope in the stage's .cu, after the factory function is defined:
static fz::Stage* MyStage_fromHeader(const uint8_t* c, size_t n) { ... } FZ_REGISTER_STAGE_FACTORY(fz::StageType::MY_STAGE, MyStage_fromHeader);
| #define FZ_REGISTER_SIMPLE_STAGE | ( | TYPE, | |
| STAGE_CLASS | |||
| ) |
Convenience for a stage with no template dispatch — reconstruction is just new StageClass() + deserializeHeader(). Place at file scope in the .cu: