50 std::optional<gpu::ReductionLayout>
layout;
104 std::string
name()
const override;
119 const std::string& container,
127 const std::string& container,
136 const std::string& container,
138 const std::vector<ReductionLoopDomain>& inner_domains
Definition structured_sdfg.h:30
Represents a loop with an associative/commutative reduction carried dependency.
Definition reduce.h:106
Represents a schedule type for Map nodes.
Definition structured_loop.h:31
Base class for structured loop constructs.
Definition structured_loop.h:244
ReductionBufferInfo estimate_schedule(structured_control_flow::Reduce &reduction, const std::string &container, ReductionBufferInfo footprint, const ReductionScheduleProposal &proposal) const
Reprice a caller-owned exact footprint under a read-only schedule override.
ReductionKernelInfo kernel(const structured_control_flow::StructuredLoop &root) const
Sum shared allocation contributions at or below root, charging each owner once.
std::string name() const override
ReductionBufferInfo estimate_interchange(structured_control_flow::Reduce &reduction, const std::string &container, ReductionBufferInfo footprint, const transformations::LoopSwap &proposal) const
Recompute geometry and allocation ownership from proposed symbolic interchange headers.
bool supports_schedule(structured_control_flow::StructuredLoop &loop, const structured_control_flow::ScheduleType &schedule) const
Check exactness and materialized-buffer compatibility for a proposed schedule, including sibling redu...
void run(analysis::AnalysisManager &analysis_manager) override
Bind the manager and options for dependency queries.
ReductionBufferInfo buffer(structured_control_flow::Reduce &reduction, const std::string &container) const
Infer an independent result, including bounded or unsupported results.
bool supports_interchange(const transformations::LoopSwap &proposal) const
Check interchange analytically without constructing a proposal graph.
std::vector< structured_control_flow::Reduce * > affected_reductions(structured_control_flow::StructuredLoop &loop) const
Return GPU reductions at, above, or below loop in the current graph.
ReductionBufferInfo estimate_geometry(structured_control_flow::Reduce &reduction, const std::string &container, ReductionBufferInfo footprint, const std::vector< ReductionLoopDomain > &inner_domains) const
Recompute an exact footprint from deepest-first domains without changing allocation topology.
ReductionBufferInfo require(structured_control_flow::Reduce &reduction, const std::string &container) const
Require an exact footprint, throwing InvalidSDFGException otherwise.
bool is_partial_buffer(const std::string &container) const
Whether a GPU reduction schedule references container as a private or shared partial.
ReductionBufferAnalysis(StructuredSDFG &sdfg)
Bind the subject graph; AnalysisManager initializes dependencies through run().
SymEngine::RCP< const SymEngine::Basic > Expression
Reference-counted pointer to a symbolic expression (SymEngine Basic).
Definition symbolic.h:83
SymEngine::RCP< const SymEngine::Symbol > Symbol
Reference-counted pointer to a SymEngine Symbol.
Definition symbolic.h:71
SymEngine::RCP< const SymEngine::Integer > Integer
Reference-counted pointer to a SymEngine Integer constant.
Definition symbolic.h:77
Definition gpu_tile_target.h:13
ReductionBufferStatus
How precisely the analysis can describe a reduction's storage requirements.
Definition reduction_buffer_analysis.h:16
@ Exact
Exact layout and allocation costs, suitable for materialization.
Definition reduction_buffer_analysis.h:17
@ Unsupported
No supported footprint; consult the diagnostic.
Definition reduction_buffer_analysis.h:19
@ ConservativeBound
Allocation upper bounds only; not a materializable layout.
Definition reduction_buffer_analysis.h:18
One accumulator's logical footprint and allocation contribution.
Definition reduction_buffer_analysis.h:45
std::optional< int64_t > shared_bytes
Per-block shared allocation contributed by this reduction.
Definition reduction_buffer_analysis.h:59
bool materialized
The reduction retains an original index and its packed buffers were validated.
Definition reduction_buffer_analysis.h:68
std::optional< int64_t > element_bytes
Scalar element width in bytes, rounded up from the primitive bit width.
Definition reduction_buffer_analysis.h:55
std::string diagnostic
Explanation for a non-exact result.
Definition reduction_buffer_analysis.h:48
std::string private_buffer
Schedule references to materialized partials; empty before placement.
Definition reduction_buffer_analysis.h:65
std::optional< gpu::ReductionLayout > layout
Original-address to compact-slot mapping, present only for exact results.
Definition reduction_buffer_analysis.h:50
symbolic::Expression accumulator_index
Original body index, retained after accesses are redirected to partials.
Definition reduction_buffer_analysis.h:52
std::optional< int64_t > private_bytes
Per-thread private allocation, or zero when no private partial is needed.
Definition reduction_buffer_analysis.h:57
std::string shared_buffer
Definition reduction_buffer_analysis.h:66
std::optional< types::PrimitiveType > primitive
Definition reduction_buffer_analysis.h:53
ReductionBufferStatus status
Definition reduction_buffer_analysis.h:46
std::optional< size_t > shared_owner
Element ID of the shared allocation's owner, including for nested users.
Definition reduction_buffer_analysis.h:61
symbolic::Expression linear_thread_index
Flattened block-thread coordinate for a shared owner; null otherwise.
Definition reduction_buffer_analysis.h:63
bool multi_output
The original index has inner-loop output axes, including unit-count axes.
Definition reduction_buffer_analysis.h:70
Aggregate reduction-owned shared storage; excludes unrelated staging buffers.
Definition reduction_buffer_analysis.h:74
ReductionBufferStatus status
Definition reduction_buffer_analysis.h:75
std::optional< int64_t > shared_bytes
Exact bytes or an upper bound, according to status; absent if unsupported.
Definition reduction_buffer_analysis.h:77
std::string diagnostic
Definition reduction_buffer_analysis.h:78
One projected affine loop domain; geometry queries consume domains deepest first.
Definition reduction_buffer_analysis.h:29
symbolic::Expression count
Definition reduction_buffer_analysis.h:32
static ReductionLoopDomain from_header(const symbolic::Symbol &indvar, const transformations::LoopHeader &header)
symbolic::Integer stride
Definition reduction_buffer_analysis.h:33
symbolic::Expression init
Definition reduction_buffer_analysis.h:31
symbolic::Symbol indvar
Definition reduction_buffer_analysis.h:30
A schedule-only change; loop domains, access expressions, and nesting stay fixed.
Definition reduction_buffer_analysis.h:23
structured_control_flow::StructuredLoop & loop
Definition reduction_buffer_analysis.h:24
const structured_control_flow::ScheduleType & schedule
Definition reduction_buffer_analysis.h:25