docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
memlet.h File Reference

Edges in the dataflow graph representing data movement. More...

Go to the source code of this file.

Classes

class  sdfg::data_flow::Memlet
 Edge in the dataflow graph representing data movement. More...

Namespaces

namespace  sdfg
namespace  sdfg::builder
namespace  sdfg::data_flow

Typedefs

typedef symbolic::MultiExpression sdfg::data_flow::Subset
 Type alias for a subset specification (array of symbolic expressions).

Enumerations

enum  sdfg::data_flow::MemletType { sdfg::data_flow::Computational , sdfg::data_flow::Reference , sdfg::data_flow::Dereference_Src , sdfg::data_flow::Dereference_Dst }
 Type of data movement represented by a memlet. More...

Detailed Description

Edges in the dataflow graph representing data movement.

Memlets are edges in the SDFG dataflow graph that describe data movement between nodes. They specify what data is transferred, how it is accessed, and the type of the data being moved.

Key Concepts

Memlet Types

Memlets can be of several types:

  • Computational: Transfers data between access nodes and code nodes (most common)
  • Reference: Creates a pointer/reference to data
  • Dereference_Src/Dereference_Dst: Dereferences pointers

Connectors

Memlets connect specific connectors on nodes:

  • void connector: Used on access nodes (no named connector)
  • named connectors: Used on code nodes (e.g., "_in1", "_out")

Subset

A subset describes which portion of data is accessed, represented as a vector of symbolic expressions. For scalars, the subset is empty. For arrays, it specifies indices or ranges.

Base Type

The base type is the type of the data container being accessed. The actual data transferred may be a scalar element (via subset) or the full container.

Example Usage

Creating a computational memlet:

// Transfer scalar data from access node to tasklet input
builder.add_computational_memlet(
state,
access_node, // source
tasklet, // destination
"_in", // destination connector
{} // empty subset for scalar
);

Creating a memlet with array subset:

// Access element at index i
auto i = symbolic::symbol("i");
builder.add_computational_memlet(
state,
array_access,
tasklet,
"_in",
{i} // subset: array[i]
);

Querying memlet properties:

MemletType type = memlet.type();
const DataFlowNode& src = memlet.src();
const DataFlowNode& dst = memlet.dst();
const std::string& conn = memlet.dst_conn();
const Subset& subset = memlet.subset();
See also
DataFlowNode for node types
AccessNode for data access points
CodeNode for computation nodes
DataFlowGraph for graph container