docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
sdfg::offloading::DataOffloadingNode Class Referenceabstract

Name does not match current function. More...

#include <sdfg/targets/offloading/data_offloading_node.h>

Inheritance diagram for sdfg::offloading::DataOffloadingNode:
[legend]

Public Member Functions

 DataOffloadingNode (size_t element_id, const DebugInfo &debug_info, const graph::Vertex vertex, data_flow::DataFlowGraph &parent, const data_flow::LibraryNodeCode code, DataTransferDirection transfer_direction, BufferLifecycle buffer_lifecycle, symbolic::Expression size)
 DataOffloadingNode (size_t element_id, const DebugInfo &debug_info, const graph::Vertex vertex, data_flow::DataFlowGraph &parent, const data_flow::LibraryNodeCode code, const std::vector< std::string > &outputs, const std::vector< std::string > &inputs, DataTransferDirection transfer_direction, BufferLifecycle buffer_lifecycle, symbolic::Expression size)
 Allows to manually override the connector names for subclasses.
DataTransferDirection transfer_direction () const
BufferLifecycle buffer_lifecycle () const
int host_ptr_input_idx () const
int dev_ptr_input_idx () const
int dev_ptr_output_idx () const
const std::string & dev_in_conn () const
const std::string & dev_out_conn () const
const std::string & host_in_conn () const
const symbolic::Expression size () const
void set_size (const symbolic::Expression &size)
virtual const symbolic::Expression alloc_size () const
symbolic::SymbolSet symbols () const override
 Get all symbols used in this node.
void replace (const symbolic::Expression old_expression, const symbolic::Expression new_expression) override
virtual symbolic::Expression flop () const override
 Calculate floating point operations for this node.
virtual std::string toStr () const override
 Convert node to string representation.
virtual bool is_compatible_with (const DataOffloadingNode &other) const
 Checks that the nodes operate on the same device and compatible data.
virtual bool redundant_with (const DataOffloadingNode &other) const
 The 2 nodes are opposites of each other that could cancel each other out.
virtual bool equal_with (const DataOffloadingNode &other) const
 The 2 nodes do the same thing.
virtual bool is_same_target (const DataOffloadingNode &other) const =0
virtual bool blocking () const =0
bool is_d2h () const
bool is_h2d () const
bool has_transfer () const
bool is_free () const
bool is_alloc () const
void remove_free ()
void remove_h2d ()
void remove_d2h ()
data_flow::PointerAccessType pointer_access_type (int input_idx) const override
 Describes what a pointer is used for.
data_flow::EdgeRemoveOption can_remove_out_edge (const data_flow::DataFlowGraph &graph, const data_flow::Memlet *memlet) const override
 Is the edge in question removable, or will this make the node its an output on invalid?
data_flow::EdgeRemoveOption can_remove_in_edge (const data_flow::DataFlowGraph &graph, const data_flow::Memlet *memlet) const override
bool update_edge_removed (const std::string &out_conn) override
Public Member Functions inherited from sdfg::data_flow::LibraryNode
 LibraryNode (const LibraryNode &data_node)=delete
LibraryNode & operator= (const LibraryNode &)=delete
virtual ~LibraryNode ()=default
ElementType type_id () const override
 Returns the type of the element.
const LibraryNodeCode & code () const
 Get the operation code.
const ImplementationType & implementation_type () const
 Get the implementation type (const).
ImplementationType & implementation_type ()
 Get the implementation type (mutable).
void set_implementation_type (const ImplementationType &impl_type)
bool side_effect () const override
 Check if this node has side effects.
PointerAccessType pointer_access_type (const Memlet &edge) const
virtual bool relocalize_operand (int input_idx, const math::tensor::TensorLayout &packed)
 Repoint the operand at input_idx to a locally staged buffer.
virtual bool can_relocalize_operand (int input_idx, const math::tensor::TensorLayout &packed) const
 Side-effect-free predicate mirroring relocalize_operand: whether the operand at input_idx can be repointed at the buffer view packed.
virtual std::optional< SubgroupAccess > operand_access (int input_idx, unsigned subgroup_size) const
 The elements one subgroup of subgroup_size lanes reads from the operand at input_idx, if the node declares them.
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
bool pointer_use_creates_side_effects (const DataFlowGraph &dataflow, const Function &func)
Public Member Functions inherited from sdfg::data_flow::CodeNode
 CodeNode (const CodeNode &data_node)=delete
CodeNode & operator= (const CodeNode &)=delete
void validate (const Function &function) const override
 Validate the code node's configuration.
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 std::unique_ptr< DataFlowNode > clone (size_t element_id, const graph::Vertex vertex, DataFlowGraph &parent) const =0
 Clone this node for graph transformations.
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.
virtual void replace (const symbolic::ExpressionMapping &replacements)

Static Protected Member Functions

static std::vector< std::string > output_conns (DataTransferDirection transfer_direction, BufferLifecycle buffer_lifecycle)
static std::vector< std::string > input_conns (DataTransferDirection transfer_direction, BufferLifecycle buffer_lifecycle)

Protected Attributes

DataTransferDirection transfer_direction_
BufferLifecycle buffer_lifecycle_
symbolic::Expression size_
 In Bytes.
Protected Attributes inherited from sdfg::data_flow::LibraryNode
LibraryNodeCode code_
 Operation identifier (e.g., "GEMM", "Add").
bool side_effect_
 Whether this node has side effects.
ImplementationType implementation_type_
 How to implement this node.
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_

Additional Inherited Members

Static Public Member Functions inherited from sdfg::data_flow::LibraryNode
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.
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::LibraryNode
 LibraryNode (size_t element_id, const DebugInfo &debug_info, const graph::Vertex vertex, DataFlowGraph &parent, const LibraryNodeCode &code, const std::vector< std::string > &outputs, const std::vector< std::string > &inputs, const bool side_effect, const ImplementationType &implementation_type)
 Protected constructor for library nodes.
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.

Detailed Description

Name does not match current function.

Specific to Offloaded buffer handling, where copies of original data are introduced or the canonical data is moved around

Constructor & Destructor Documentation

◆ DataOffloadingNode() [1/2]

sdfg::offloading::DataOffloadingNode::DataOffloadingNode ( size_t element_id,
const DebugInfo & debug_info,
const graph::Vertex vertex,
data_flow::DataFlowGraph & parent,
const data_flow::LibraryNodeCode code,
DataTransferDirection transfer_direction,
BufferLifecycle buffer_lifecycle,
symbolic::Expression size )

◆ DataOffloadingNode() [2/2]

sdfg::offloading::DataOffloadingNode::DataOffloadingNode ( size_t element_id,
const DebugInfo & debug_info,
const graph::Vertex vertex,
data_flow::DataFlowGraph & parent,
const data_flow::LibraryNodeCode code,
const std::vector< std::string > & outputs,
const std::vector< std::string > & inputs,
DataTransferDirection transfer_direction,
BufferLifecycle buffer_lifecycle,
symbolic::Expression size )

Allows to manually override the connector names for subclasses.

Subclasses may also need to override other methods to match if order and count of connectors differs

Member Function Documentation

◆ alloc_size()

virtual const symbolic::Expression sdfg::offloading::DataOffloadingNode::alloc_size ( ) const
virtual

◆ blocking()

virtual bool sdfg::offloading::DataOffloadingNode::blocking ( ) const
pure virtual

◆ buffer_lifecycle()

BufferLifecycle sdfg::offloading::DataOffloadingNode::buffer_lifecycle ( ) const

◆ can_remove_in_edge()

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

◆ can_remove_out_edge()

data_flow::EdgeRemoveOption sdfg::offloading::DataOffloadingNode::can_remove_out_edge ( const data_flow::DataFlowGraph & graph,
const data_flow::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.

◆ dev_in_conn()

const std::string & sdfg::offloading::DataOffloadingNode::dev_in_conn ( ) const

◆ dev_out_conn()

const std::string & sdfg::offloading::DataOffloadingNode::dev_out_conn ( ) const

◆ dev_ptr_input_idx()

int sdfg::offloading::DataOffloadingNode::dev_ptr_input_idx ( ) const

◆ dev_ptr_output_idx()

int sdfg::offloading::DataOffloadingNode::dev_ptr_output_idx ( ) const

◆ equal_with()

virtual bool sdfg::offloading::DataOffloadingNode::equal_with ( const DataOffloadingNode & other) const
virtual

◆ flop()

virtual symbolic::Expression sdfg::offloading::DataOffloadingNode::flop ( ) const
overridevirtual

Calculate floating point operations for this node.

Returns
Symbolic expression for FLOP count (or null)

Reimplemented from sdfg::data_flow::LibraryNode.

◆ has_transfer()

bool sdfg::offloading::DataOffloadingNode::has_transfer ( ) const

◆ host_in_conn()

const std::string & sdfg::offloading::DataOffloadingNode::host_in_conn ( ) const

◆ host_ptr_input_idx()

int sdfg::offloading::DataOffloadingNode::host_ptr_input_idx ( ) const

◆ input_conns()

std::vector< std::string > sdfg::offloading::DataOffloadingNode::input_conns ( DataTransferDirection transfer_direction,
BufferLifecycle buffer_lifecycle )
staticprotected

◆ is_alloc()

bool sdfg::offloading::DataOffloadingNode::is_alloc ( ) const

◆ is_compatible_with()

virtual bool sdfg::offloading::DataOffloadingNode::is_compatible_with ( const DataOffloadingNode & other) const
virtual

Checks that the nodes operate on the same device and compatible data.

◆ is_d2h()

bool sdfg::offloading::DataOffloadingNode::is_d2h ( ) const

◆ is_free()

bool sdfg::offloading::DataOffloadingNode::is_free ( ) const

◆ is_h2d()

bool sdfg::offloading::DataOffloadingNode::is_h2d ( ) const

◆ is_same_target()

virtual bool sdfg::offloading::DataOffloadingNode::is_same_target ( const DataOffloadingNode & other) const
pure virtual

◆ output_conns()

std::vector< std::string > sdfg::offloading::DataOffloadingNode::output_conns ( DataTransferDirection transfer_direction,
BufferLifecycle buffer_lifecycle )
staticprotected

◆ pointer_access_type()

data_flow::PointerAccessType sdfg::offloading::DataOffloadingNode::pointer_access_type ( int input_idx) const
overridevirtual

Describes what a pointer is used for.

Parameters
input_idxindex of input that is a pointer.
Returns
Invalid if not asked about a pointer input

Reimplemented from sdfg::data_flow::LibraryNode.

◆ redundant_with()

virtual bool sdfg::offloading::DataOffloadingNode::redundant_with ( const DataOffloadingNode & other) const
virtual

The 2 nodes are opposites of each other that could cancel each other out.

Reimplemented in sdfg::cuda::CUDADataOffloadingNode, sdfg::offloading::ExternalDataOffloadingNode, and sdfg::rocm::ROCMDataOffloadingNode.

◆ remove_d2h()

void sdfg::offloading::DataOffloadingNode::remove_d2h ( )

◆ remove_free()

void sdfg::offloading::DataOffloadingNode::remove_free ( )

◆ remove_h2d()

void sdfg::offloading::DataOffloadingNode::remove_h2d ( )

◆ replace()

void sdfg::offloading::DataOffloadingNode::replace ( const symbolic::Expression old_expression,
const symbolic::Expression new_expression )
overridevirtual

Implements sdfg::Element.

Reimplemented in sdfg::rocm::ROCMDataOffloadingNode.

◆ set_size()

void sdfg::offloading::DataOffloadingNode::set_size ( const symbolic::Expression & size)

◆ size()

const symbolic::Expression sdfg::offloading::DataOffloadingNode::size ( ) const

◆ symbols()

symbolic::SymbolSet sdfg::offloading::DataOffloadingNode::symbols ( ) const
overridevirtual

Get all symbols used in this node.

Returns
Set of symbolic expressions used by this node

Implements sdfg::data_flow::LibraryNode.

Reimplemented in sdfg::rocm::ROCMDataOffloadingNode.

◆ toStr()

virtual std::string sdfg::offloading::DataOffloadingNode::toStr ( ) const
overridevirtual

Convert node to string representation.

Returns
String representation of the node

Reimplemented from sdfg::data_flow::LibraryNode.

◆ transfer_direction()

DataTransferDirection sdfg::offloading::DataOffloadingNode::transfer_direction ( ) const

◆ update_edge_removed()

bool sdfg::offloading::DataOffloadingNode::update_edge_removed ( const std::string & out_conn)
overridevirtual
Parameters
out_conna output connector, whose edge was just removed after approval via [can_remove_out_edge] == EdgeRemoveOption::RequiresUpdate
Returns
edge removal is completed, node is valid without edge

Reimplemented from sdfg::data_flow::DataFlowNode.

Member Data Documentation

◆ buffer_lifecycle_

BufferLifecycle sdfg::offloading::DataOffloadingNode::buffer_lifecycle_
protected

◆ size_

symbolic::Expression sdfg::offloading::DataOffloadingNode::size_
protected

In Bytes.

◆ transfer_direction_

DataTransferDirection sdfg::offloading::DataOffloadingNode::transfer_direction_
protected

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