FZGPUModules 2.0
GPU-accelerated modular compression pipelines
Loading...
Searching...
No Matches
fusion_planner.h
Go to the documentation of this file.
1#pragma once
2
3/*
4 * ADVANCED API — no source-compatibility promise. The types here (CompressionDAG,
5 * DAGNode, BufferInfo, the fusion planner/registry) are pipeline internals exposed
6 * for advanced/experimental use; they may change or be removed in any release.
7 * Most users only need <fzgpumodules.h> / pipeline/compressor.h. See the API tiers
8 * in docs/api_reference.md.
9 */
10
31#include "stage/fusion.h"
32#include <cstdint>
33#include <string>
34#include <vector>
35
36namespace fz {
37
38class Stage;
39class CompressionDAG;
40
43 uint32_t block_size = 0;
44 uint32_t selector_tile_size = 0;
45 uint32_t coder_unit_size = 0;
46
47 bool tileAdaptive() const { return selector_tile_size != 0; }
48};
49
51enum class FusionCompatibility : uint8_t {
52 Compatible = 0,
53 UnfusableStage,
54 InvalidTileGeometry,
55 TileAfterBlockLocal,
56 MultipleTileSelectors,
57 TileInteriorStageUnsupported,
58 StandardBlockMismatch,
59 TileCoderUnitMismatch,
60};
61
64 FusionGeometry& geometry, const FusionSpec& next);
65
66const char* fusionCompatibilityName(FusionCompatibility result);
67
70 std::vector<Stage*> stages;
71 std::vector<std::string> stage_names;
72 uint32_t block_size = 0;
73 uint32_t selector_tile_size = 0;
74 uint32_t coder_unit_size = 0;
75 bool has_tile_adaptive = false;
76 bool has_coder = false;
77};
78
82std::vector<FusionGroup> planFusionGroups(const CompressionDAG& dag);
83
84} // namespace fz
Definition dag.h:101
Definition dag.h:24
FusionCompatibility
Exact reason a stage spec cannot extend an accumulated group geometry.
Definition fusion_planner.h:51
FusionCompatibility extendFusionGeometry(FusionGeometry &geometry, const FusionSpec &next)
Validate and, on success, extend geometry with next.
std::vector< FusionGroup > planFusionGroups(const CompressionDAG &dag)
Geometry accumulated while extending one candidate fusion chain.
Definition fusion_planner.h:42
uint32_t coder_unit_size
coder units nested in selector tile
Definition fusion_planner.h:45
uint32_t block_size
legacy same-size block/chunk path
Definition fusion_planner.h:43
uint32_t selector_tile_size
TileAdaptive selector unit.
Definition fusion_planner.h:44
One maximal fusion-legality domain, in producer→consumer order.
Definition fusion_planner.h:69
bool has_coder
ends in a Cooperative coder
Definition fusion_planner.h:76
uint32_t selector_tile_size
TileAdaptive unit, else 0.
Definition fusion_planner.h:73
uint32_t coder_unit_size
nested coder unit, else 0
Definition fusion_planner.h:74
std::vector< std::string > stage_names
node names, parallel to stages
Definition fusion_planner.h:71
uint32_t block_size
shared block size (0 if all Map)
Definition fusion_planner.h:72
std::vector< Stage * > stages
the fused chain, front = producer
Definition fusion_planner.h:70
A stage's fusion contract. Stages that can participate in a fused kernel override Stage::getFusionSpe...
Definition fusion.h:52