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
33#include "stage/fusion.h"
34#include <cstdint>
35#include <string>
36#include <vector>
37
38namespace fz {
39
40class Stage;
41class CompressionDAG;
42
45 uint32_t block_size = 0;
46 uint32_t selector_tile_size = 0;
47 uint32_t coder_unit_size = 0;
48
49 bool hasTileSelector() const { return selector_tile_size != 0; }
50};
51
53enum class FusionCompatibility : uint8_t {
54 Compatible = 0,
55 UnfusableStage,
56 InvalidTileGeometry,
57 TileAfterRegionLocal,
58 MultipleTileSelectors,
59 TileInteriorStageUnsupported,
60 StandardBlockMismatch,
61 TileCoderUnitMismatch,
62};
63
66 FusionGeometry& geometry, const FusionSpec& next);
67
68const char* fusionCompatibilityName(FusionCompatibility result);
69
72 std::vector<Stage*> stages;
73 std::vector<std::string> stage_names;
74 uint32_t block_size = 0;
75 uint32_t selector_tile_size = 0;
76 uint32_t coder_unit_size = 0;
77 bool has_tile_selector = false;
78 bool has_coder = false;
79};
80
84std::vector<FusionGroup> planFusionGroups(const CompressionDAG& dag);
85
86} // namespace fz
Definition dag.h:104
Definition dag.h:24
FusionCompatibility
Exact reason a stage spec cannot extend an accumulated group geometry.
Definition fusion_planner.h:53
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:44
uint32_t coder_unit_size
codec segments nested in selector tile
Definition fusion_planner.h:47
uint32_t block_size
legacy same-size block/chunk path
Definition fusion_planner.h:45
uint32_t selector_tile_size
TileSelector unit.
Definition fusion_planner.h:46
One maximal fusion-legality domain, in producer→consumer order.
Definition fusion_planner.h:71
bool has_coder
ends in a SegmentCodec
Definition fusion_planner.h:78
uint32_t selector_tile_size
TileSelector unit, else 0.
Definition fusion_planner.h:75
uint32_t coder_unit_size
nested codec segment, else 0
Definition fusion_planner.h:76
std::vector< std::string > stage_names
node names, parallel to stages
Definition fusion_planner.h:73
uint32_t block_size
shared region size (0 if all Elementwise)
Definition fusion_planner.h:74
std::vector< Stage * > stages
the fused chain, front = producer
Definition fusion_planner.h:72
A stage's fusion contract. Stages that can participate in a fused kernel override Stage::getFusionSpe...
Definition fusion.h:51