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

Library node definitions for calling functions beyond simple instructions. More...

#include <optional>
#include <string>
#include <vector>
#include "sdfg/data_flow/code_node.h"
#include "sdfg/data_flow/pointer_metadata.h"
#include "sdfg/graph/graph.h"
#include "sdfg/symbolic/symbolic.h"

Go to the source code of this file.

Classes

struct  sdfg::data_flow::SubgroupAccess
 The operand elements one subgroup touches in a single access: for every lane, the operand coordinates it reads, in register order. More...
class  sdfg::data_flow::LibraryNode
 Base class for all library nodes in the dataflow graph. More...

Namespaces

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

Typedefs

typedef StringEnum sdfg::data_flow::LibraryNodeCode
typedef StringEnum sdfg::data_flow::ImplementationType
 Implementation type identifier for library nodes.

Variables

ImplementationType sdfg::data_flow::ImplementationType_NONE {""}
 Default implementation type indicating no specific implementation.

Detailed Description

Library node definitions for calling functions beyond simple instructions.

Library nodes are objects of the dataflow graph that represent pre-defined operations that can have multiple implementations and can be expanded into more primitive operations.

Key Concepts

Library Nodes

Library nodes provide a high-level abstraction for complex operations such as:

  • Mathematical operations (BLAS, tensor operations)
  • Standard library functions (malloc, memcpy, memset)
  • Custom function calls

Implementation Types

Library nodes can have different implementations specified via ImplementationType:

  • ImplementationType_NONE: No specific implementation, single dispatcher or expansion
  • Custom implementation types (e.g., BLAS, CUBLAS) for selection of dispatcher

The implementation type determines how the library node is code-generated:

  • If implementation_type is NONE, the node may only have a single dispatcher or must be expanded
  • If implementation_type is set, a dispatcher generates specific code

Example

Creating and using a library node:

// Library node with BLAS implementation
auto& gemm_node = builder.add_library_node<math::blas::GemmNode>(
block, debug_info, implementation_type, precision, layout, ...
);
// Library node that will be expanded
auto& tensor_add = builder.add_library_node<math::tensor::AddNode>(
block, debug_info, shape
);
See also
math::MathNode for mathematical library nodes
codegen::LibraryNodeDispatcher for code generation
serializer::LibraryNodeSerializer for serialization