5#include <unordered_set>
45 std::vector<symbolic::Expression>
bases;
49 std::vector<symbolic::Expression>
maxes;
51 std::vector<symbolic::Expression>
strides;
67 std::vector<symbolic::Expression>
original_subset(
const std::vector<symbolic::Expression>& tile_indices)
const;
70 std::vector<symbolic::Expression>
local_index(
const std::vector<symbolic::Expression>& access_subset)
const;
80 std::string container_;
81 std::string local_name_;
85 bool swizzle_layout_ =
false;
86 bool lane_contiguous_ =
false;
87 bool transpose_layout_ =
false;
89 std::unordered_set<const data_flow::Memlet*> group_memlets_;
90 std::vector<structured_control_flow::Reduce*> reduce_retargets_;
92 std::vector<structured_control_flow::Reduce*> grid_reduce_owners_;
94 bool atomic_merge_ =
false;
95 bool container_read_ =
false;
96 bool container_written_ =
false;
115 bool needs_copy_in()
const {
116 return container_read_;
120 bool needs_copy_out()
const {
121 return container_written_;
125 size_t max_tile_elements()
const {
137 const symbolic::Assumptions& assums = {}
143 void emit_private_copy(
144 builder::StructuredSDFGBuilder& builder,
145 analysis::AnalysisManager& analysis_manager,
146 structured_control_flow::Sequence& parent,
147 const tiles::PackedBuffer& buffer,
148 const types::IType& buffer_type,
149 const types::IType& pointer_type,
157 tiles::TiledCopy plan;
158 std::vector<int> coop_axes;
159 tiles::TileGuard guard;
161 size_t coop_lanes = 1;
170 BuiltCopy build_tiled_copy(
171 analysis::AnalysisManager& analysis_manager,
172 structured_control_flow::Sequence& guard_scope,
173 const tiles::PackedBuffer& buffer,
174 const types::IType& pointer_type,
175 const std::vector<symbolic::Expression>& slot_sizes,
176 const std::vector<symbolic::Expression>& slot_indices,
177 const std::vector<symbolic::Expression>& slot_indvars,
178 const std::vector<symbolic::Expression>& slot_inits,
179 const std::vector<symbolic::Expression>& slot_strides
186 builder::StructuredSDFGBuilder& builder,
187 structured_control_flow::Sequence& scope,
188 structured_control_flow::ControlFlowNode& anchor,
190 const BuiltCopy& copy,
192 const types::IType& pointer_type,
194 bool leading_barrier,
195 bool trailing_barrier
200 tiles::TileGuard tile_boundary_guard(
201 analysis::AnalysisManager& analysis_manager,
202 structured_control_flow::Sequence& guard_scope,
203 const std::vector<symbolic::Expression>& vsizes
209 builder::StructuredSDFGBuilder& builder,
210 analysis::AnalysisManager& analysis_manager,
211 const tiles::PackedBuffer& buffer,
212 const types::IType& buffer_type,
213 const std::vector<symbolic::Expression>& slot_indices
218 std::optional<math::tensor::TensorLayout> operand_view(
219 const analysis::MemoryTile& access,
220 const tiles::PackedBuffer& buffer,
221 const std::vector<symbolic::Expression>& slot_indices
227 void choose_conflict_policy(
228 analysis::AnalysisManager& analysis_manager, tiles::PackedBuffer& buffer,
types::PrimitiveType element_type
251 bool swizzle_layout =
false,
252 bool lane_contiguous =
false,
253 bool transpose_layout =
false
255 : loop_(loop), access_node_(access_node), container_(access_node.data()),
256 storage_type_(
types::StorageType::CPU_Stack()), swizzle_layout_(swizzle_layout),
257 lane_contiguous_(lane_contiguous), transpose_layout_(transpose_layout) {
260 std::string
name()
const override {
261 return "LocalStorage";
277 void to_json(nlohmann::json& j)
const override;
294 return storage_type_;
Access nodes for reading/writing data in the dataflow graph.
The destination side of a tiled copy — the packed local buffer — as a (possibly swizzled) Layout over...
Note: Even though the class references unique_ptr, it will never delete an SDFG it has a reference to...
Definition structured_sdfg_builder.h:44
Node representing access to a data container in the dataflow graph.
Definition access_node.h:84
Base class for structured loop constructs.
Definition structured_loop.h:244
How a tile relates to its enclosing parallel loop nest, and the storage space that relationship deman...
Definition locality.h:24
Represents the storage location and management characteristics of data.
Definition type.h:64
Integer integer(int64_t value)
Creates an integer constant.
SymEngine::RCP< const SymEngine::Basic > Expression
Reference-counted pointer to a symbolic expression (SymEngine Basic).
Definition symbolic.h:83
std::set< Symbol, SymEngine::RCPBasicKeyLess > SymbolSet
Ordered set of symbols.
Definition symbolic.h:95
SymEngine::RCP< const SymEngine::Boolean > Condition
Reference-counted pointer to a boolean condition expression.
Definition symbolic.h:86
Edges in the dataflow graph representing data movement.
Analysis for inferring memory layouts of memlets.
Definition function_builder.h:10
StringEnum ImplementationType
Implementation type identifier for library nodes.
Definition library_node.h:75
symbolic::MultiExpression Subset
Type alias for a subset specification (array of symbolic expressions).
Definition memlet.h:103
math::tensor::TensorLayout Layout
The tiles geometry type is math::tensor::TensorLayout — the single source of truth for a (shape,...
Definition layout.h:11
CopyDirection
Which way the tile moves between the flat (global) side and the packed buffer.
Definition tiled_copy.h:38
PrimitiveType
Enumeration of all primitive data types supported by sdfglib.
Definition type.h:35
Reduction-ownership queries for localization: which Reduce nodes accumulate into a container relative...
Symbolic system for integer-based symbol analysis.
A tiled copy plan: move one tile between memory levels.
Core type system definitions for sdfglib.