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

Simple computational operation in the dataflow graph. More...

#include <sdfg/data_flow/tasklet.h>

Inheritance diagram for sdfg::data_flow::Tasklet:
[legend]

Public Member Functions

 Tasklet (const Tasklet &data_node)=delete
Tasklet & operator= (const Tasklet &)=delete
ElementType type_id () const override
 Returns the type of the element.
void validate (const Function &function) const override
 Validate the tasklet.
bool side_effect () const override
 Check if this node has side effects Side effect on dflow nodes is broad.
TaskletCode code () const
 Get the operation code.
bool is_assign () const
 Check if this is an assignment operation.
bool is_trivial (const Function &function) const
 Check if this is a trivial (no-op) assignment.
bool is_cast (const Function &function) const
 Check if this is a type cast.
bool is_zext (const Function &function) const
 Check if this is a zero-extend cast.
bool is_sext (const Function &function) const
 Check if this is a sign-extend cast.
bool is_trunc (const Function &function) const
 Check if this is a truncate cast.
bool is_fptoui (const Function &function) const
 Check if this is a float-to-unsigned-int cast.
bool is_fptosi (const Function &function) const
 Check if this is a float-to-signed-int cast.
bool is_uitofp (const Function &function) const
 Check if this is an unsigned-int-to-float cast.
bool is_sitofp (const Function &function) const
 Check if this is a signed-int-to-float cast.
bool is_fpext (const Function &function) const
 Check if this is a float precision extension cast.
bool is_fptrunc (const Function &function) const
 Check if this is a float precision truncation cast.
const std::string & output () const
 Get the output connector name (single output).
virtual std::unique_ptr< DataFlowNode > clone (size_t element_id, const graph::Vertex vertex, DataFlowGraph &parent) const override
 Clone this tasklet for graph transformations.
void replace (const symbolic::Expression old_expression, const symbolic::Expression new_expression) override
 Replace symbolic expressions in this tasklet.
void replace (const symbolic::ExpressionMapping &replacements) override
EdgeRemoveOption can_remove_out_edge (const data_flow::DataFlowGraph &graph, const Memlet *memlet) const override
 Is the edge in question removable, or will this make the node its an output on invalid?
EdgeRemoveOption can_remove_in_edge (const data_flow::DataFlowGraph &graph, const Memlet *memlet) const override
Public Member Functions inherited from sdfg::data_flow::CodeNode
 CodeNode (const CodeNode &data_node)=delete
CodeNode & operator= (const CodeNode &)=delete
const std::vector< std::string > & outputs () const
 Get output connector names (const).
const std::vector< std::string > & inputs () const
 Get input connector names (const).
std::vector< std::string > & outputs ()
 Get output connector names (mutable).
std::vector< std::string > & inputs ()
 Get input connector names (mutable).
const std::string & output (size_t index) const
 Get output connector name by index.
const std::string & input (size_t index) const
 Get input connector name by index.
bool has_constant_input (size_t index) const
 Check if an input is connected to a constant node.
Public Member Functions inherited from sdfg::data_flow::DataFlowNode
 DataFlowNode (const DataFlowNode &data_node)=delete
DataFlowNode & operator= (const DataFlowNode &)=delete
graph::Vertex vertex () const
 Get the graph vertex for this node.
const DataFlowGraph & get_parent () const
 Get the parent dataflow graph (const).
DataFlowGraph & get_parent ()
 Get the parent dataflow graph (mutable).
virtual bool update_edge_removed (const std::string &out_conn)
Public Member Functions inherited from sdfg::Element
 Element (size_t element_id, const DebugInfo &debug_info)
virtual ~Element ()=default
size_t element_id () const
const DebugInfo & debug_info () const
void set_debug_info (const DebugInfo &debug_info)
void add_metadata (const std::string &key, const std::string &value)
void remove_metadata (const std::string &key)
const std::string & metadata (const std::string &key) const
const std::string * metadata_if_exists (const std::string &key) const
const std::unordered_map< std::string, std::string > & metadata () const
std::string_view element_type () const
 Returns the type of the element as a human-readable string.

Static Public Member Functions

static bool classof (const Element &element)
Static Public Member Functions inherited from sdfg::data_flow::CodeNode
static bool classof (const Element &element)
 LLVM-style RTTI predicate: true if element is a CodeNode.
Static Public Member Functions inherited from sdfg::data_flow::DataFlowNode
static bool classof (const Element &element)
 LLVM-style RTTI predicate: true if element is a DataFlowNode.

Friends

class sdfg::builder::FunctionBuilder
class sdfg::builder::SDFGBuilder
class sdfg::builder::StructuredSDFGBuilder

Additional Inherited Members

Static Public Attributes inherited from sdfg::data_flow::CodeNode
static constexpr ElementType TypeGroup = ElementType::Tasklet | ElementType::LibraryNode
 Bitmask of all concrete ElementTypes that are CodeNodes.
Static Public Attributes inherited from sdfg::data_flow::DataFlowNode
static constexpr ElementType TypeGroup
 Bitmask of all concrete ElementTypes that are DataFlowNodes.
Protected Member Functions inherited from sdfg::data_flow::CodeNode
 CodeNode (size_t element_id, const DebugInfo &debug_info, const graph::Vertex vertex, DataFlowGraph &parent, const std::vector< std::string > &outputs, const std::vector< std::string > &inputs)
 Protected constructor for code nodes.
Protected Member Functions inherited from sdfg::data_flow::DataFlowNode
 DataFlowNode (size_t element_id, const DebugInfo &debug_info, const graph::Vertex vertex, DataFlowGraph &parent)
 Protected constructor for dataflow nodes.
Protected Attributes inherited from sdfg::data_flow::CodeNode
std::vector< std::string > outputs_
 Names of output connectors.
std::vector< std::string > inputs_
 Names of input connectors.
Protected Attributes inherited from sdfg::Element
size_t element_id_
DebugInfo debug_info_
std::unordered_map< std::string, std::string > metadata_

Detailed Description

Simple computational operation in the dataflow graph.

Tasklets represent primitive operations like arithmetic, comparisons, and type conversions. They are lightweight code nodes with a single operation code and fixed input/output structure.

Key features:

  • Single operation per tasklet
  • Type-aware (integer, floating-point, or generic)
  • Automatic type conversion detection
  • LLVM-like operation semantics

Constructor & Destructor Documentation

◆ Tasklet()

sdfg::data_flow::Tasklet::Tasklet ( const Tasklet & data_node)
delete

Member Function Documentation

◆ can_remove_in_edge()

EdgeRemoveOption sdfg::data_flow::Tasklet::can_remove_in_edge ( const data_flow::DataFlowGraph & graph,
const Memlet * memlet ) const
overridevirtual

◆ can_remove_out_edge()

EdgeRemoveOption sdfg::data_flow::Tasklet::can_remove_out_edge ( const data_flow::DataFlowGraph & graph,
const Memlet * memlet ) const
overridevirtual

Is the edge in question removable, or will this make the node its an output on invalid?

Currently, some nodes may require every out connector to have at least 1 connection attached

Returns
NotRemovable, NoDependencies, CustomRemove

[NotRemovable] means only if the entire node can be removed, can the edge be removed [NoDependencies] means, the edge can be removed trivially, the node will work without for the remaining functions [CustomRemove] means, a call to [remove_out_edge] can have the node remove the edge itself and make necessary

Implements sdfg::data_flow::DataFlowNode.

◆ classof()

bool sdfg::data_flow::Tasklet::classof ( const Element & element)
inlinestatic

◆ clone()

virtual std::unique_ptr< DataFlowNode > sdfg::data_flow::Tasklet::clone ( size_t element_id,
const graph::Vertex vertex,
DataFlowGraph & parent ) const
overridevirtual

Clone this tasklet for graph transformations.

Parameters
element_idNew element identifier
vertexNew graph vertex
parentParent graph for the clone
Returns
Unique pointer to the cloned tasklet

Implements sdfg::data_flow::DataFlowNode.

◆ code()

TaskletCode sdfg::data_flow::Tasklet::code ( ) const

Get the operation code.

Returns
TaskletCode for this tasklet

◆ is_assign()

bool sdfg::data_flow::Tasklet::is_assign ( ) const

Check if this is an assignment operation.

Returns
True if the code is TaskletCode::assign

◆ is_cast()

bool sdfg::data_flow::Tasklet::is_cast ( const Function & function) const

Check if this is a type cast.

Parameters
functionFunction context for type checking
Returns
True if assign with different input/output types

◆ is_fpext()

bool sdfg::data_flow::Tasklet::is_fpext ( const Function & function) const

Check if this is a float precision extension cast.

Parameters
functionFunction context for type checking
Returns
True if float to double

◆ is_fptosi()

bool sdfg::data_flow::Tasklet::is_fptosi ( const Function & function) const

Check if this is a float-to-signed-int cast.

Parameters
functionFunction context for type checking
Returns
True if float/double to signed integer

◆ is_fptoui()

bool sdfg::data_flow::Tasklet::is_fptoui ( const Function & function) const

Check if this is a float-to-unsigned-int cast.

Parameters
functionFunction context for type checking
Returns
True if float/double to unsigned integer

◆ is_fptrunc()

bool sdfg::data_flow::Tasklet::is_fptrunc ( const Function & function) const

Check if this is a float precision truncation cast.

Parameters
functionFunction context for type checking
Returns
True if double to float

◆ is_sext()

bool sdfg::data_flow::Tasklet::is_sext ( const Function & function) const

Check if this is a sign-extend cast.

Parameters
functionFunction context for type checking
Returns
True if signed to larger signed integer

◆ is_sitofp()

bool sdfg::data_flow::Tasklet::is_sitofp ( const Function & function) const

Check if this is a signed-int-to-float cast.

Parameters
functionFunction context for type checking
Returns
True if signed integer to float/double

◆ is_trivial()

bool sdfg::data_flow::Tasklet::is_trivial ( const Function & function) const

Check if this is a trivial (no-op) assignment.

Parameters
functionFunction context for type checking
Returns
True if assign with identical input/output types

◆ is_trunc()

bool sdfg::data_flow::Tasklet::is_trunc ( const Function & function) const

Check if this is a truncate cast.

Parameters
functionFunction context for type checking
Returns
True if larger to smaller integer

◆ is_uitofp()

bool sdfg::data_flow::Tasklet::is_uitofp ( const Function & function) const

Check if this is an unsigned-int-to-float cast.

Parameters
functionFunction context for type checking
Returns
True if unsigned integer to float/double

◆ is_zext()

bool sdfg::data_flow::Tasklet::is_zext ( const Function & function) const

Check if this is a zero-extend cast.

Parameters
functionFunction context for type checking
Returns
True if unsigned to larger unsigned integer

◆ operator=()

Tasklet & sdfg::data_flow::Tasklet::operator= ( const Tasklet & )
delete

◆ output()

const std::string & sdfg::data_flow::Tasklet::output ( ) const

Get the output connector name (single output).

Returns
Name of the output connector

◆ replace() [1/2]

void sdfg::data_flow::Tasklet::replace ( const symbolic::Expression old_expression,
const symbolic::Expression new_expression )
overridevirtual

Replace symbolic expressions in this tasklet.

Parameters
old_expressionExpression to replace
new_expressionReplacement expression

Implements sdfg::Element.

◆ replace() [2/2]

void sdfg::data_flow::Tasklet::replace ( const symbolic::ExpressionMapping & replacements)
overridevirtual

Reimplemented from sdfg::Element.

◆ side_effect()

bool sdfg::data_flow::Tasklet::side_effect ( ) const
inlinenodiscardoverridevirtual

Check if this node has side effects Side effect on dflow nodes is broad.

It just means it cannot be removed just because there are no more direct consumers in the dataflow But underneath, a accessNode-write is considered as having a side effect for this purpose. Closer inspection of access nodes could show those side effects as being irrelevant if never read and fully owned

Implements sdfg::data_flow::DataFlowNode.

◆ type_id()

ElementType sdfg::data_flow::Tasklet::type_id ( ) const
inlineoverridevirtual

Returns the type of the element.

Implements sdfg::Element.

◆ validate()

void sdfg::data_flow::Tasklet::validate ( const Function & function) const
overridevirtual

Validate the tasklet.

Parameters
functionFunction context for validation
Exceptions
InvalidSDFGExceptionif validation fails

Reimplemented from sdfg::data_flow::CodeNode.

◆ sdfg::builder::FunctionBuilder

friend class sdfg::builder::FunctionBuilder
friend

◆ sdfg::builder::SDFGBuilder

friend class sdfg::builder::SDFGBuilder
friend

◆ sdfg::builder::StructuredSDFGBuilder


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