spcl / dace

DaCe - Data Centric Parallel Programming
http://dace.is/fast
BSD 3-Clause "New" or "Revised" License
487 stars 121 forks source link

Undefined Symbols #1581

Open tbennun opened 3 months ago

tbennun commented 3 months ago

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: