docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
Symbol and Constant Creation

Functions for creating symbols and constant values. More...

Functions

Symbol sdfg::symbolic::symbol (const std::string &name)
 Creates a symbolic variable with the given name.
Integer sdfg::symbolic::integer (int64_t value)
 Creates an integer constant.
Integer sdfg::symbolic::zero ()
 Creates the integer constant 0.
Integer sdfg::symbolic::one ()
 Creates the integer constant 1.
Condition sdfg::symbolic::__false__ ()
 Creates a boolean false condition.
Condition sdfg::symbolic::__true__ ()
 Creates a boolean true condition.
Symbol sdfg::symbolic::__nullptr__ ()
 Creates a special null pointer symbol.
bool sdfg::symbolic::is_nullptr (const Symbol symbol)
 Checks if a symbol is the null pointer.
bool sdfg::symbolic::is_nullptr (const std::string &name)
 Same as is_nullptr(symbol(name)) without constructing a symbol.
bool sdfg::symbolic::is_pointer (const Symbol symbol)
 Checks if a symbol represents a pointer.
bool sdfg::symbolic::is_nv (const Symbol symbol)
 Checks if a symbol is an NVIDIA GPU built-in variable.

Detailed Description

Functions for creating symbols and constant values.

Function Documentation

◆ __false__()

Condition sdfg::symbolic::__false__ ( )

Creates a boolean false condition.

Returns
False as a Condition

◆ __nullptr__()

Symbol sdfg::symbolic::__nullptr__ ( )

Creates a special null pointer symbol.

Returns
A Symbol representing the null pointer

In the symbolic system, pointers are interpreted as integers without dereferencing. This function provides a special symbol to represent null pointer values.

◆ __true__()

Condition sdfg::symbolic::__true__ ( )

Creates a boolean true condition.

Returns
True as a Condition

◆ integer()

Integer sdfg::symbolic::integer ( int64_t value)

Creates an integer constant.

Parameters
valueThe integer value
Returns
An Integer constant expression
auto two = symbolic::integer(2);
auto negative = symbolic::integer(-5);
Integer integer(int64_t value)
Creates an integer constant.

◆ is_nullptr() [1/2]

bool sdfg::symbolic::is_nullptr ( const std::string & name)

Same as is_nullptr(symbol(name)) without constructing a symbol.

◆ is_nullptr() [2/2]

bool sdfg::symbolic::is_nullptr ( const Symbol symbol)

Checks if a symbol is the null pointer.

Parameters
symbolThe symbol to check
Returns
true if the symbol represents a null pointer

◆ is_nv()

bool sdfg::symbolic::is_nv ( const Symbol symbol)

Checks if a symbol is an NVIDIA GPU built-in variable.

Parameters
symbolThe symbol to check
Returns
true if the symbol is threadIdx, blockIdx, blockDim, or gridDim in any dimension

NVIDIA GPU built-in variables include threadIdx_{x,y,z}, blockIdx_{x,y,z}, blockDim_{x,y,z}, and gridDim_{x,y,z}.

◆ is_pointer()

bool sdfg::symbolic::is_pointer ( const Symbol symbol)

Checks if a symbol represents a pointer.

Parameters
symbolThe symbol to check
Returns
true if the symbol is a pointer (currently equivalent to is_nullptr)

◆ one()

Integer sdfg::symbolic::one ( )

Creates the integer constant 1.

Returns
One as an Integer expression

◆ symbol()

Symbol sdfg::symbolic::symbol ( const std::string & name)

Creates a symbolic variable with the given name.

Parameters
nameThe name of the symbol (must not be "null", "NULL", or "nullptr")
Returns
A new Symbol with the specified name
Exceptions
InvalidSDFGExceptionif name is a reserved keyword
auto x = symbolic::symbol("x");
auto loop_bound = symbolic::symbol("N");
Symbol symbol(const std::string &name)
Creates a symbolic variable with the given name.

◆ zero()

Integer sdfg::symbolic::zero ( )

Creates the integer constant 0.

Returns
Zero as an Integer expression