docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
sdfg::builder::StructuredSDFGBuilder Class Reference

Note: Even though the class references unique_ptr, it will never delete an SDFG it has a reference to. More...

#include <sdfg/builder/structured_sdfg_builder.h>

Inheritance diagram for sdfg::builder::StructuredSDFGBuilder:
[legend]

Public Types

using InsertionPoint = int32_t

Public Member Functions

 StructuredSDFGBuilder (StructuredSDFG &sdfg)
 To modify an existing SDFG.
 StructuredSDFGBuilder (std::unique_ptr< StructuredSDFG > &sdfg)
 Will take ownership of the SDFG Increases compatibility with legacy code.
 StructuredSDFGBuilder (const std::string &name, FunctionType type)
 StructuredSDFGBuilder (const std::string &name, FunctionType type, const types::IType &return_type)
 StructuredSDFGBuilder (SDFG &sdfg)
StructuredSDFG & subject () const
std::unique_ptr< StructuredSDFG > move ()
void rename_container (const std::string &old_name, const std::string &new_name) const override
void rename_containers (const std::vector< std::pair< std::string, std::string > > &renames) const
 Applies several renames with a single tree traversal; old names must be distinct and not renamed targets.
Element * find_element_by_id (const size_t &element_id) const
virtual void replace_symbols (const symbolic::Expression old_expression, const symbolic::Expression new_expression) override
 Replace symbolic expressions on the whole SDFG.
virtual void replace_symbols (const symbolic::ExpressionMapping &replacements) override
Sequence & add_sequence (Sequence &parent, const DebugInfo &debug_info=DebugInfo())
Sequence & add_sequence_before (Sequence &parent, ControlFlowNode &block, const DebugInfo &debug_info=DebugInfo())
Sequence & add_sequence_after (Sequence &parent, ControlFlowNode &block, const DebugInfo &debug_info=DebugInfo())
Sequence & add_sequence_at (Sequence &parent, InsertionPoint insertion_point, const DebugInfo &debug_info=DebugInfo())
void remove_from_parent (ControlFlowNode &child)
void remove_child (Sequence &parent, size_t index)
void remove_children (Sequence &parent)
void move_child (Sequence &source, size_t source_index, Sequence &target)
void move_child (Sequence &source, size_t source_index, Sequence &target, size_t target_index)
void move_children (Sequence &source, Sequence &target)
void move_children (Sequence &source, Sequence &target, size_t target_index)
Sequence & hoist_root ()
AssignmentBlock & add_assignments (Sequence &parent, const Assignments &assignments, const DebugInfo &debug_info=DebugInfo())
AssignmentBlock & add_assignments_before (Sequence &parent, ControlFlowNode &child, const Assignments &assignments, const DebugInfo &debug_info=DebugInfo())
AssignmentBlock & add_assignments_after (Sequence &parent, ControlFlowNode &child, const Assignments &assignments, const DebugInfo &debug_info=DebugInfo())
AssignmentBlock & add_assignments_at (Sequence &parent, InsertionPoint insertion_point, const Assignments &assignments, const DebugInfo &debug_info=DebugInfo())
Block & add_block (Sequence &parent, const DebugInfo &debug_info=DebugInfo())
Block & add_block (Sequence &parent, const data_flow::DataFlowGraph &data_flow_graph, const DebugInfo &debug_info=DebugInfo())
Block & add_block_before (Sequence &parent, ControlFlowNode &child, const DebugInfo &debug_info=DebugInfo())
Block & add_block_before (Sequence &parent, ControlFlowNode &child, data_flow::DataFlowGraph &data_flow_graph, const DebugInfo &debug_info=DebugInfo())
Block & add_block_after (Sequence &parent, ControlFlowNode &child, const DebugInfo &debug_info=DebugInfo())
Block & add_block_after (Sequence &parent, ControlFlowNode &child, data_flow::DataFlowGraph &data_flow_graph, const DebugInfo &debug_info=DebugInfo())
Block & add_block_at (Sequence &parent, InsertionPoint insertion_point, const DebugInfo &debug_info=DebugInfo())
IfElse & add_if_else (Sequence &parent, const DebugInfo &debug_info=DebugInfo())
IfElse & add_if_else_before (Sequence &parent, ControlFlowNode &child, const DebugInfo &debug_info=DebugInfo())
IfElse & add_if_else_after (Sequence &parent, ControlFlowNode &child, const DebugInfo &debug_info=DebugInfo())
Sequence & add_case (IfElse &scope, const sdfg::symbolic::Condition cond, const DebugInfo &debug_info=DebugInfo())
void remove_case (IfElse &scope, size_t i, const DebugInfo &debug_info=DebugInfo())
While & add_while (Sequence &parent, const DebugInfo &debug_info=DebugInfo())
For & add_for (Sequence &parent, const symbolic::Symbol indvar, const symbolic::Condition condition, const symbolic::Expression init, const symbolic::Expression update, const DebugInfo &debug_info=DebugInfo())
For & add_for_before (Sequence &parent, ControlFlowNode &child, const symbolic::Symbol indvar, const symbolic::Condition condition, const symbolic::Expression init, const symbolic::Expression update, const DebugInfo &debug_info=DebugInfo())
For & add_for_after (Sequence &parent, ControlFlowNode &child, const symbolic::Symbol indvar, const symbolic::Condition condition, const symbolic::Expression init, const symbolic::Expression update, const DebugInfo &debug_info=DebugInfo())
For & add_for_at (Sequence &parent, InsertionPoint insertion_point, const symbolic::Symbol indvar, const symbolic::Condition condition, const symbolic::Expression init, const symbolic::Expression update, const ScheduleType &schedule_type, const DebugInfo &debug_info=DebugInfo())
Map & add_map (Sequence &parent, const symbolic::Symbol indvar, const symbolic::Condition condition, const symbolic::Expression init, const symbolic::Expression update, const ScheduleType &schedule_type, const DebugInfo &debug_info=DebugInfo())
Map & add_map_after (Sequence &parent, ControlFlowNode &child, const symbolic::Symbol indvar, const symbolic::Condition condition, const symbolic::Expression init, const symbolic::Expression update, const ScheduleType &schedule_type, const DebugInfo &debug_info=DebugInfo())
Map & add_map_before (Sequence &parent, ControlFlowNode &child, const symbolic::Symbol indvar, const symbolic::Condition condition, const symbolic::Expression init, const symbolic::Expression update, const ScheduleType &schedule_type, const DebugInfo &debug_info=DebugInfo())
Map & add_map_at (Sequence &parent, InsertionPoint insertion_point, const symbolic::Symbol indvar, const symbolic::Condition condition, const symbolic::Expression init, const symbolic::Expression update, const ScheduleType &schedule_type, const DebugInfo &debug_info=DebugInfo())
Reduce & add_reduce (Sequence &parent, const symbolic::Symbol indvar, const symbolic::Condition condition, const symbolic::Expression init, const symbolic::Expression update, const std::vector< structured_control_flow::ReductionInfo > &reductions, const ScheduleType &schedule_type, const DebugInfo &debug_info=DebugInfo())
Reduce & add_reduce_before (Sequence &parent, ControlFlowNode &child, const symbolic::Symbol indvar, const symbolic::Condition condition, const symbolic::Expression init, const symbolic::Expression update, const std::vector< structured_control_flow::ReductionInfo > &reductions, const ScheduleType &schedule_type, const DebugInfo &debug_info=DebugInfo())
Reduce & add_reduce_after (Sequence &parent, ControlFlowNode &child, const symbolic::Symbol indvar, const symbolic::Condition condition, const symbolic::Expression init, const symbolic::Expression update, const std::vector< structured_control_flow::ReductionInfo > &reductions, const ScheduleType &schedule_type, const DebugInfo &debug_info=DebugInfo())
Continue & add_continue (Sequence &parent, const DebugInfo &debug_info=DebugInfo())
Break & add_break (Sequence &parent, const DebugInfo &debug_info=DebugInfo())
Return & add_return (Sequence &parent, const std::string &data, const DebugInfo &debug_info=DebugInfo())
Return & add_constant_return (Sequence &parent, const std::string &data, const types::IType &type, const DebugInfo &debug_info=DebugInfo())
For & convert_while (Sequence &parent, While &loop, const symbolic::Symbol indvar, const symbolic::Condition condition, const symbolic::Expression init, const symbolic::Expression update)
Map & convert_for (Sequence &parent, For &loop)
Reduce & convert_for_to_reduce (Sequence &parent, For &loop, const std::vector< structured_control_flow::ReductionInfo > &reductions)
Map & convert_reduce_to_map (Sequence &parent, Reduce &reduce)
void update_if_else_condition (IfElse &if_else, size_t branch, const symbolic::Condition cond)
void update_loop (StructuredLoop &loop, const symbolic::Symbol indvar, const symbolic::Condition condition, const symbolic::Expression init, const symbolic::Expression update)
void update_schedule_type (StructuredLoop &loop, const ScheduleType &schedule_type, bool keep_nest_annotations=true)
 Replace the schedule type of a loop.
void remove_schedule_property (StructuredLoop &loop, const std::string &key)
 Remove a single property (if present) from the schedule type of a loop.
data_flow::AccessNode & add_access (structured_control_flow::Block &block, const std::string &data, const DebugInfo &debug_info=DebugInfo())
data_flow::ConstantNode & add_constant (structured_control_flow::Block &block, const std::string &data, const types::IType &type, const DebugInfo &debug_info=DebugInfo())
data_flow::Tasklet & add_tasklet (structured_control_flow::Block &block, const data_flow::TaskletCode code, const std::string &output, const std::vector< std::string > &inputs, const DebugInfo &debug_info=DebugInfo())
data_flow::Memlet & add_memlet (structured_control_flow::Block &block, data_flow::DataFlowNode &src, const std::string &src_conn, data_flow::DataFlowNode &dst, const std::string &dst_conn, const data_flow::Subset &subset, const types::IType &base_type, const DebugInfo &debug_info)
data_flow::Memlet & add_computational_memlet (structured_control_flow::Block &block, data_flow::AccessNode &src, data_flow::CodeNode &dst, const std::string &dst_conn, const data_flow::Subset &subset, const types::IType &base_type, const DebugInfo &debug_info=DebugInfo())
data_flow::Memlet & add_computational_memlet (structured_control_flow::Block &block, data_flow::CodeNode &src, const std::string &src_conn, data_flow::AccessNode &dst, const data_flow::Subset &subset, const types::IType &base_type, const DebugInfo &debug_info=DebugInfo())
data_flow::Memlet & add_computational_memlet (structured_control_flow::Block &block, data_flow::AccessNode &src, data_flow::Tasklet &dst, const std::string &dst_conn, const data_flow::Subset &subset, const DebugInfo &debug_info=DebugInfo())
data_flow::Memlet & add_computational_memlet (structured_control_flow::Block &block, data_flow::Tasklet &src, const std::string &src_conn, data_flow::AccessNode &dst, const data_flow::Subset &subset, const DebugInfo &debug_info=DebugInfo())
data_flow::Memlet & add_reference_memlet (structured_control_flow::Block &block, data_flow::AccessNode &src, data_flow::AccessNode &dst, const data_flow::Subset &subset, const types::IType &base_type, const DebugInfo &debug_info=DebugInfo())
data_flow::Memlet & add_dereference_memlet (structured_control_flow::Block &block, data_flow::AccessNode &src, data_flow::AccessNode &dst, bool derefs_src, const types::IType &base_type, const DebugInfo &debug_info=DebugInfo())
template<typename T, typename... Args>
data_flow::LibraryNode & add_library_node (structured_control_flow::Block &block, const DebugInfo &debug_info, Args... arguments)
data_flow::DataFlowNode & copy_node (structured_control_flow::Block &block, const data_flow::DataFlowNode &node)
void remove_memlet (structured_control_flow::Block &block, const data_flow::Memlet &edge)
void remove_node (structured_control_flow::Block &block, const data_flow::DataFlowNode &node)
data_flow::Memlet & replace_memlet_src_with_constant (structured_control_flow::Block &block, data_flow::Memlet &edge, const std::string &data, const types::IType &type)
 Replaces the source of a computational read memlet with a new ConstantNode carrying data/type.
void clear_code_node_legacy (structured_control_flow::Block &block, const data_flow::CodeNode &node)
 Removes a code node and all its input and output edges.
void clear_access_node_legacy (structured_control_flow::Block &block, const data_flow::AccessNode &node)
 Removes a code node and maybe some of its inputs as well.
int clear_node (structured_control_flow::Block &block, const data_flow::DataFlowNode &node)
 Shorthand for clear_node with the node itself being the only one to ignore side-effects on.
int clear_node (structured_control_flow::Block &block, const data_flow::DataFlowNode &node, const std::unordered_set< const data_flow::DataFlowNode * > &ignore_side_effects)
 New function to remove all unneeded edges and nodes transitively.
int clear_ptr_borrow_edge (Block &block, const data_flow::Memlet &edge)
void merge_siblings (data_flow::AccessNode &in_node)
void merge_sinks (structured_control_flow::Block &block)
 Walks all sink nodes of a block's dataflow graph and merges access nodes that refer to the same container into a single sink access node, redirecting their incoming memlets.
Public Member Functions inherited from sdfg::builder::FunctionBuilder
virtual ~FunctionBuilder ()=default
void set_return_type (const types::IType &type) const
const types::IType & add_container (const std::string &name, const types::IType &type, bool is_argument=false, bool is_external=false) const
const types::IType & add_external (const std::string &name, const types::IType &type, LinkageType linkage_type) const
void remove_container (const std::string &name) const
void change_type (const std::string &name, const types::IType &type) const
types::StructureDefinition & add_structure (const std::string &name, bool is_packed) const
std::unique_ptr< types::Structure > create_vector_type (const types::Scalar &element_type, size_t vector_size)
std::string find_new_name (std::string prefix="tmp_") const
void set_element_counter (size_t element_counter)
void update_tasklet (data_flow::Tasklet &tasklet, const data_flow::TaskletCode code)
 Common Dataflow Operations.

Protected Member Functions

Function & function () const override
Protected Member Functions inherited from sdfg::builder::FunctionBuilder
size_t new_element_id () const
size_t new_element_id_batch (size_t batch) const

Detailed Description

Note: Even though the class references unique_ptr, it will never delete an SDFG it has a reference to.

Member Typedef Documentation

◆ InsertionPoint

Constructor & Destructor Documentation

◆ StructuredSDFGBuilder() [1/5]

sdfg::builder::StructuredSDFGBuilder::StructuredSDFGBuilder ( StructuredSDFG & sdfg)

To modify an existing SDFG.

◆ StructuredSDFGBuilder() [2/5]

sdfg::builder::StructuredSDFGBuilder::StructuredSDFGBuilder ( std::unique_ptr< StructuredSDFG > & sdfg)

Will take ownership of the SDFG Increases compatibility with legacy code.

Also more idiomatic for SDFGs that are being deserialized and are not yet owned_ by the registry

◆ StructuredSDFGBuilder() [3/5]

sdfg::builder::StructuredSDFGBuilder::StructuredSDFGBuilder ( const std::string & name,
FunctionType type )

◆ StructuredSDFGBuilder() [4/5]

sdfg::builder::StructuredSDFGBuilder::StructuredSDFGBuilder ( const std::string & name,
FunctionType type,
const types::IType & return_type )

◆ StructuredSDFGBuilder() [5/5]

sdfg::builder::StructuredSDFGBuilder::StructuredSDFGBuilder ( SDFG & sdfg)

Member Function Documentation

◆ add_access()

data_flow::AccessNode & sdfg::builder::StructuredSDFGBuilder::add_access ( structured_control_flow::Block & block,
const std::string & data,
const DebugInfo & debug_info = DebugInfo() )

◆ add_assignments()

AssignmentBlock & sdfg::builder::StructuredSDFGBuilder::add_assignments ( Sequence & parent,
const Assignments & assignments,
const DebugInfo & debug_info = DebugInfo() )

◆ add_assignments_after()

AssignmentBlock & sdfg::builder::StructuredSDFGBuilder::add_assignments_after ( Sequence & parent,
ControlFlowNode & child,
const Assignments & assignments,
const DebugInfo & debug_info = DebugInfo() )

◆ add_assignments_at()

AssignmentBlock & sdfg::builder::StructuredSDFGBuilder::add_assignments_at ( Sequence & parent,
InsertionPoint insertion_point,
const Assignments & assignments,
const DebugInfo & debug_info = DebugInfo() )

◆ add_assignments_before()

AssignmentBlock & sdfg::builder::StructuredSDFGBuilder::add_assignments_before ( Sequence & parent,
ControlFlowNode & child,
const Assignments & assignments,
const DebugInfo & debug_info = DebugInfo() )

◆ add_block() [1/2]

Block & sdfg::builder::StructuredSDFGBuilder::add_block ( Sequence & parent,
const data_flow::DataFlowGraph & data_flow_graph,
const DebugInfo & debug_info = DebugInfo() )
Parameters
data_flow_graphcopies the contents of this into the new block

◆ add_block() [2/2]

Block & sdfg::builder::StructuredSDFGBuilder::add_block ( Sequence & parent,
const DebugInfo & debug_info = DebugInfo() )

◆ add_block_after() [1/2]

Block & sdfg::builder::StructuredSDFGBuilder::add_block_after ( Sequence & parent,
ControlFlowNode & child,
const DebugInfo & debug_info = DebugInfo() )

◆ add_block_after() [2/2]

Block & sdfg::builder::StructuredSDFGBuilder::add_block_after ( Sequence & parent,
ControlFlowNode & child,
data_flow::DataFlowGraph & data_flow_graph,
const DebugInfo & debug_info = DebugInfo() )

◆ add_block_at()

Block & sdfg::builder::StructuredSDFGBuilder::add_block_at ( Sequence & parent,
InsertionPoint insertion_point,
const DebugInfo & debug_info = DebugInfo() )

◆ add_block_before() [1/2]

Block & sdfg::builder::StructuredSDFGBuilder::add_block_before ( Sequence & parent,
ControlFlowNode & child,
const DebugInfo & debug_info = DebugInfo() )

◆ add_block_before() [2/2]

Block & sdfg::builder::StructuredSDFGBuilder::add_block_before ( Sequence & parent,
ControlFlowNode & child,
data_flow::DataFlowGraph & data_flow_graph,
const DebugInfo & debug_info = DebugInfo() )

◆ add_break()

Break & sdfg::builder::StructuredSDFGBuilder::add_break ( Sequence & parent,
const DebugInfo & debug_info = DebugInfo() )

◆ add_case()

Sequence & sdfg::builder::StructuredSDFGBuilder::add_case ( IfElse & scope,
const sdfg::symbolic::Condition cond,
const DebugInfo & debug_info = DebugInfo() )

◆ add_computational_memlet() [1/4]

data_flow::Memlet & sdfg::builder::StructuredSDFGBuilder::add_computational_memlet ( structured_control_flow::Block & block,
data_flow::AccessNode & src,
data_flow::CodeNode & dst,
const std::string & dst_conn,
const data_flow::Subset & subset,
const types::IType & base_type,
const DebugInfo & debug_info = DebugInfo() )

◆ add_computational_memlet() [2/4]

data_flow::Memlet & sdfg::builder::StructuredSDFGBuilder::add_computational_memlet ( structured_control_flow::Block & block,
data_flow::AccessNode & src,
data_flow::Tasklet & dst,
const std::string & dst_conn,
const data_flow::Subset & subset,
const DebugInfo & debug_info = DebugInfo() )

◆ add_computational_memlet() [3/4]

data_flow::Memlet & sdfg::builder::StructuredSDFGBuilder::add_computational_memlet ( structured_control_flow::Block & block,
data_flow::CodeNode & src,
const std::string & src_conn,
data_flow::AccessNode & dst,
const data_flow::Subset & subset,
const types::IType & base_type,
const DebugInfo & debug_info = DebugInfo() )

◆ add_computational_memlet() [4/4]

data_flow::Memlet & sdfg::builder::StructuredSDFGBuilder::add_computational_memlet ( structured_control_flow::Block & block,
data_flow::Tasklet & src,
const std::string & src_conn,
data_flow::AccessNode & dst,
const data_flow::Subset & subset,
const DebugInfo & debug_info = DebugInfo() )

◆ add_constant()

data_flow::ConstantNode & sdfg::builder::StructuredSDFGBuilder::add_constant ( structured_control_flow::Block & block,
const std::string & data,
const types::IType & type,
const DebugInfo & debug_info = DebugInfo() )

◆ add_constant_return()

Return & sdfg::builder::StructuredSDFGBuilder::add_constant_return ( Sequence & parent,
const std::string & data,
const types::IType & type,
const DebugInfo & debug_info = DebugInfo() )

◆ add_continue()

Continue & sdfg::builder::StructuredSDFGBuilder::add_continue ( Sequence & parent,
const DebugInfo & debug_info = DebugInfo() )

◆ add_dereference_memlet()

data_flow::Memlet & sdfg::builder::StructuredSDFGBuilder::add_dereference_memlet ( structured_control_flow::Block & block,
data_flow::AccessNode & src,
data_flow::AccessNode & dst,
bool derefs_src,
const types::IType & base_type,
const DebugInfo & debug_info = DebugInfo() )

◆ add_for()

For & sdfg::builder::StructuredSDFGBuilder::add_for ( Sequence & parent,
const symbolic::Symbol indvar,
const symbolic::Condition condition,
const symbolic::Expression init,
const symbolic::Expression update,
const DebugInfo & debug_info = DebugInfo() )

◆ add_for_after()

For & sdfg::builder::StructuredSDFGBuilder::add_for_after ( Sequence & parent,
ControlFlowNode & child,
const symbolic::Symbol indvar,
const symbolic::Condition condition,
const symbolic::Expression init,
const symbolic::Expression update,
const DebugInfo & debug_info = DebugInfo() )

◆ add_for_at()

For & sdfg::builder::StructuredSDFGBuilder::add_for_at ( Sequence & parent,
InsertionPoint insertion_point,
const symbolic::Symbol indvar,
const symbolic::Condition condition,
const symbolic::Expression init,
const symbolic::Expression update,
const ScheduleType & schedule_type,
const DebugInfo & debug_info = DebugInfo() )

◆ add_for_before()

For & sdfg::builder::StructuredSDFGBuilder::add_for_before ( Sequence & parent,
ControlFlowNode & child,
const symbolic::Symbol indvar,
const symbolic::Condition condition,
const symbolic::Expression init,
const symbolic::Expression update,
const DebugInfo & debug_info = DebugInfo() )

◆ add_if_else()

IfElse & sdfg::builder::StructuredSDFGBuilder::add_if_else ( Sequence & parent,
const DebugInfo & debug_info = DebugInfo() )

◆ add_if_else_after()

IfElse & sdfg::builder::StructuredSDFGBuilder::add_if_else_after ( Sequence & parent,
ControlFlowNode & child,
const DebugInfo & debug_info = DebugInfo() )

◆ add_if_else_before()

IfElse & sdfg::builder::StructuredSDFGBuilder::add_if_else_before ( Sequence & parent,
ControlFlowNode & child,
const DebugInfo & debug_info = DebugInfo() )

◆ add_library_node()

template<typename T, typename... Args>
data_flow::LibraryNode & sdfg::builder::StructuredSDFGBuilder::add_library_node ( structured_control_flow::Block & block,
const DebugInfo & debug_info,
Args... arguments )
inline

◆ add_map()

Map & sdfg::builder::StructuredSDFGBuilder::add_map ( Sequence & parent,
const symbolic::Symbol indvar,
const symbolic::Condition condition,
const symbolic::Expression init,
const symbolic::Expression update,
const ScheduleType & schedule_type,
const DebugInfo & debug_info = DebugInfo() )

◆ add_map_after()

Map & sdfg::builder::StructuredSDFGBuilder::add_map_after ( Sequence & parent,
ControlFlowNode & child,
const symbolic::Symbol indvar,
const symbolic::Condition condition,
const symbolic::Expression init,
const symbolic::Expression update,
const ScheduleType & schedule_type,
const DebugInfo & debug_info = DebugInfo() )

◆ add_map_at()

Map & sdfg::builder::StructuredSDFGBuilder::add_map_at ( Sequence & parent,
InsertionPoint insertion_point,
const symbolic::Symbol indvar,
const symbolic::Condition condition,
const symbolic::Expression init,
const symbolic::Expression update,
const ScheduleType & schedule_type,
const DebugInfo & debug_info = DebugInfo() )

◆ add_map_before()

Map & sdfg::builder::StructuredSDFGBuilder::add_map_before ( Sequence & parent,
ControlFlowNode & child,
const symbolic::Symbol indvar,
const symbolic::Condition condition,
const symbolic::Expression init,
const symbolic::Expression update,
const ScheduleType & schedule_type,
const DebugInfo & debug_info = DebugInfo() )

◆ add_memlet()

data_flow::Memlet & sdfg::builder::StructuredSDFGBuilder::add_memlet ( structured_control_flow::Block & block,
data_flow::DataFlowNode & src,
const std::string & src_conn,
data_flow::DataFlowNode & dst,
const std::string & dst_conn,
const data_flow::Subset & subset,
const types::IType & base_type,
const DebugInfo & debug_info )

◆ add_reduce()

Reduce & sdfg::builder::StructuredSDFGBuilder::add_reduce ( Sequence & parent,
const symbolic::Symbol indvar,
const symbolic::Condition condition,
const symbolic::Expression init,
const symbolic::Expression update,
const std::vector< structured_control_flow::ReductionInfo > & reductions,
const ScheduleType & schedule_type,
const DebugInfo & debug_info = DebugInfo() )

◆ add_reduce_after()

Reduce & sdfg::builder::StructuredSDFGBuilder::add_reduce_after ( Sequence & parent,
ControlFlowNode & child,
const symbolic::Symbol indvar,
const symbolic::Condition condition,
const symbolic::Expression init,
const symbolic::Expression update,
const std::vector< structured_control_flow::ReductionInfo > & reductions,
const ScheduleType & schedule_type,
const DebugInfo & debug_info = DebugInfo() )

◆ add_reduce_before()

Reduce & sdfg::builder::StructuredSDFGBuilder::add_reduce_before ( Sequence & parent,
ControlFlowNode & child,
const symbolic::Symbol indvar,
const symbolic::Condition condition,
const symbolic::Expression init,
const symbolic::Expression update,
const std::vector< structured_control_flow::ReductionInfo > & reductions,
const ScheduleType & schedule_type,
const DebugInfo & debug_info = DebugInfo() )

◆ add_reference_memlet()

data_flow::Memlet & sdfg::builder::StructuredSDFGBuilder::add_reference_memlet ( structured_control_flow::Block & block,
data_flow::AccessNode & src,
data_flow::AccessNode & dst,
const data_flow::Subset & subset,
const types::IType & base_type,
const DebugInfo & debug_info = DebugInfo() )

◆ add_return()

Return & sdfg::builder::StructuredSDFGBuilder::add_return ( Sequence & parent,
const std::string & data,
const DebugInfo & debug_info = DebugInfo() )

◆ add_sequence()

Sequence & sdfg::builder::StructuredSDFGBuilder::add_sequence ( Sequence & parent,
const DebugInfo & debug_info = DebugInfo() )

◆ add_sequence_after()

Sequence & sdfg::builder::StructuredSDFGBuilder::add_sequence_after ( Sequence & parent,
ControlFlowNode & block,
const DebugInfo & debug_info = DebugInfo() )

◆ add_sequence_at()

Sequence & sdfg::builder::StructuredSDFGBuilder::add_sequence_at ( Sequence & parent,
InsertionPoint insertion_point,
const DebugInfo & debug_info = DebugInfo() )

◆ add_sequence_before()

Sequence & sdfg::builder::StructuredSDFGBuilder::add_sequence_before ( Sequence & parent,
ControlFlowNode & block,
const DebugInfo & debug_info = DebugInfo() )

◆ add_tasklet()

data_flow::Tasklet & sdfg::builder::StructuredSDFGBuilder::add_tasklet ( structured_control_flow::Block & block,
const data_flow::TaskletCode code,
const std::string & output,
const std::vector< std::string > & inputs,
const DebugInfo & debug_info = DebugInfo() )

◆ add_while()

While & sdfg::builder::StructuredSDFGBuilder::add_while ( Sequence & parent,
const DebugInfo & debug_info = DebugInfo() )

◆ clear_access_node_legacy()

void sdfg::builder::StructuredSDFGBuilder::clear_access_node_legacy ( structured_control_flow::Block & block,
const data_flow::AccessNode & node )

Removes a code node and maybe some of its inputs as well.

◆ clear_code_node_legacy()

void sdfg::builder::StructuredSDFGBuilder::clear_code_node_legacy ( structured_control_flow::Block & block,
const data_flow::CodeNode & node )

Removes a code node and all its input and output edges.

Will remove unused access nodes at the ends of those edges. Caller must ensure that targets of output edges remain valid with their input edges removed.

◆ clear_node() [1/2]

int sdfg::builder::StructuredSDFGBuilder::clear_node ( structured_control_flow::Block & block,
const data_flow::DataFlowNode & node )

Shorthand for clear_node with the node itself being the only one to ignore side-effects on.

Returns
number of removed nodes

◆ clear_node() [2/2]

int sdfg::builder::StructuredSDFGBuilder::clear_node ( structured_control_flow::Block & block,
const data_flow::DataFlowNode & node,
const std::unordered_set< const data_flow::DataFlowNode * > & ignore_side_effects )

New function to remove all unneeded edges and nodes transitively.

Checks for side effects and other output uses. WARNING: it will remove output edges that are unused, but potentially leave the produce alive, if it has other uses. Do not use, until we support nodes with unpopulated outputs or are sure that it cannot happen as a result.

Parameters
blockthe dataflow graph in which to remove
nodethe original node, where the start the removal process
ignore_side_effectslist of nodes, for which we can ignore side effects (for access nodes, this would be writes, for code_nodes it would depend on their side_effect flag) The original node itself must also be in that list, to ignore any of its side effects!
Returns
number of removed nodes

◆ clear_ptr_borrow_edge()

int sdfg::builder::StructuredSDFGBuilder::clear_ptr_borrow_edge ( Block & block,
const data_flow::Memlet & edge )

◆ convert_for()

Map & sdfg::builder::StructuredSDFGBuilder::convert_for ( Sequence & parent,
For & loop )

◆ convert_for_to_reduce()

Reduce & sdfg::builder::StructuredSDFGBuilder::convert_for_to_reduce ( Sequence & parent,
For & loop,
const std::vector< structured_control_flow::ReductionInfo > & reductions )

◆ convert_reduce_to_map()

Map & sdfg::builder::StructuredSDFGBuilder::convert_reduce_to_map ( Sequence & parent,
Reduce & reduce )

◆ convert_while()

For & sdfg::builder::StructuredSDFGBuilder::convert_while ( Sequence & parent,
While & loop,
const symbolic::Symbol indvar,
const symbolic::Condition condition,
const symbolic::Expression init,
const symbolic::Expression update )

◆ copy_node()

data_flow::DataFlowNode & sdfg::builder::StructuredSDFGBuilder::copy_node ( structured_control_flow::Block & block,
const data_flow::DataFlowNode & node )
inline

◆ find_element_by_id()

Element * sdfg::builder::StructuredSDFGBuilder::find_element_by_id ( const size_t & element_id) const

◆ function()

Function & sdfg::builder::StructuredSDFGBuilder::function ( ) const
overrideprotectedvirtual

◆ hoist_root()

Sequence & sdfg::builder::StructuredSDFGBuilder::hoist_root ( )

◆ merge_siblings()

void sdfg::builder::StructuredSDFGBuilder::merge_siblings ( data_flow::AccessNode & in_node)

◆ merge_sinks()

void sdfg::builder::StructuredSDFGBuilder::merge_sinks ( structured_control_flow::Block & block)

Walks all sink nodes of a block's dataflow graph and merges access nodes that refer to the same container into a single sink access node, redirecting their incoming memlets.

◆ move()

std::unique_ptr< StructuredSDFG > sdfg::builder::StructuredSDFGBuilder::move ( )
Deprecated
the unique ptr required SDFGs were removed from the registry during modification to make sense. This builder does not change the pointer. But this will release any references the builder has to the SDFG to end any modification

◆ move_child() [1/2]

void sdfg::builder::StructuredSDFGBuilder::move_child ( Sequence & source,
size_t source_index,
Sequence & target )

◆ move_child() [2/2]

void sdfg::builder::StructuredSDFGBuilder::move_child ( Sequence & source,
size_t source_index,
Sequence & target,
size_t target_index )

◆ move_children() [1/2]

void sdfg::builder::StructuredSDFGBuilder::move_children ( Sequence & source,
Sequence & target )

◆ move_children() [2/2]

void sdfg::builder::StructuredSDFGBuilder::move_children ( Sequence & source,
Sequence & target,
size_t target_index )

◆ remove_case()

void sdfg::builder::StructuredSDFGBuilder::remove_case ( IfElse & scope,
size_t i,
const DebugInfo & debug_info = DebugInfo() )

◆ remove_child()

void sdfg::builder::StructuredSDFGBuilder::remove_child ( Sequence & parent,
size_t index )

◆ remove_children()

void sdfg::builder::StructuredSDFGBuilder::remove_children ( Sequence & parent)

◆ remove_from_parent()

void sdfg::builder::StructuredSDFGBuilder::remove_from_parent ( ControlFlowNode & child)

◆ remove_memlet()

void sdfg::builder::StructuredSDFGBuilder::remove_memlet ( structured_control_flow::Block & block,
const data_flow::Memlet & edge )

◆ remove_node()

void sdfg::builder::StructuredSDFGBuilder::remove_node ( structured_control_flow::Block & block,
const data_flow::DataFlowNode & node )

◆ remove_schedule_property()

void sdfg::builder::StructuredSDFGBuilder::remove_schedule_property ( StructuredLoop & loop,
const std::string & key )

Remove a single property (if present) from the schedule type of a loop.

◆ rename_container()

void sdfg::builder::StructuredSDFGBuilder::rename_container ( const std::string & old_name,
const std::string & new_name ) const
overridevirtual

Reimplemented from sdfg::builder::FunctionBuilder.

◆ rename_containers()

void sdfg::builder::StructuredSDFGBuilder::rename_containers ( const std::vector< std::pair< std::string, std::string > > & renames) const

Applies several renames with a single tree traversal; old names must be distinct and not renamed targets.

◆ replace_memlet_src_with_constant()

data_flow::Memlet & sdfg::builder::StructuredSDFGBuilder::replace_memlet_src_with_constant ( structured_control_flow::Block & block,
data_flow::Memlet & edge,
const std::string & data,
const types::IType & type )

Replaces the source of a computational read memlet with a new ConstantNode carrying data/type.

Returns
the newly created memlet from the constant to the original destination

◆ replace_symbols() [1/2]

virtual void sdfg::builder::StructuredSDFGBuilder::replace_symbols ( const symbolic::Expression old_expression,
const symbolic::Expression new_expression )
overridevirtual

Replace symbolic expressions on the whole SDFG.

Parameters
old_expressionExpression to replace
new_expressionReplacement expression

Reimplemented from sdfg::builder::FunctionBuilder.

◆ replace_symbols() [2/2]

virtual void sdfg::builder::StructuredSDFGBuilder::replace_symbols ( const symbolic::ExpressionMapping & replacements)
overridevirtual

Reimplemented from sdfg::builder::FunctionBuilder.

◆ subject()

StructuredSDFG & sdfg::builder::StructuredSDFGBuilder::subject ( ) const

◆ update_if_else_condition()

void sdfg::builder::StructuredSDFGBuilder::update_if_else_condition ( IfElse & if_else,
size_t branch,
const symbolic::Condition cond )

◆ update_loop()

void sdfg::builder::StructuredSDFGBuilder::update_loop ( StructuredLoop & loop,
const symbolic::Symbol indvar,
const symbolic::Condition condition,
const symbolic::Expression init,
const symbolic::Expression update )

◆ update_schedule_type()

void sdfg::builder::StructuredSDFGBuilder::update_schedule_type ( StructuredLoop & loop,
const ScheduleType & schedule_type,
bool keep_nest_annotations = true )

Replace the schedule type of a loop.

By default, nest-level annotations (see ScheduleType_NestAnnotations, e.g. no-fusion and zero-init) of the current schedule are kept unless schedule_type sets them itself, so that re-scheduling a nest root (offloading, parallelization, ...) does not lose them. Pass keep_nest_annotations = false to set schedule_type exactly, e.g. when a loop stops being the root of its nest.


The documentation for this class was generated from the following file: