Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined Symbols #1581

Open
tbennun opened this issue Jun 1, 2024 · 0 comments
Open

Undefined Symbols #1581

tbennun opened this issue Jun 1, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@tbennun
Copy link
Collaborator

tbennun commented Jun 1, 2024

Following the discussion on May 16, we would like to have a special kind of symbol, which is undefined.

Motivation: Symbolic analysis is crucial to DaCe and transformations. However, not every data container needs to have a concrete symbolic value for a program to function (nor does it have one). For example, if a pointer is given from an external source without a size, the resulting data container's size is undefined. The fact that some containers do not have a symbolic size should not disrupt the analysis of other symbols (iterates, transient containers, other data containers with size information).

Why is it a problem? Right now, if such a data container has no concrete size, or any other symbol remains in an SDFG, the generated code will include another argument with that symbol. This defers the error to a compilation error, or a segmentation fault if the SDFG is called with one fewer parameter. Such errors are unclear to a user, are reported too late, and are not attached to the right source information as to which part of the code caused it. For example, is it a result of an erroneous transformation? If it's not part of SDFG validation, one can never debug such an issue.

Implementation: symbolic.UndefinedSymbol will be a subclass of symbolic.symbol. Therefore, it will behave the same way as a normal symbol, with a few exceptions:

  • Undefined symbols have a name of "?" and any comparison with another symbolic expression will yield an indeterminate solution.
  • Like NaN values, any operation on an undefined symbol results in an undefined symbol after simplification. For example: N + ? = ?
  • During validation and code generation, if such a symbol is ever used in a way that would generate code, an informative exception will be raised.
@tbennun tbennun added the enhancement New feature or request label Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant