You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a code generator issue, as the final signature of the C function of __return is a scalar and not a pointer (okay calling it on the Python side must also be different then).
The ability to return scalars is an intended behaviour, see CompiledSDFG._convert_return_values() that handles this case, but it does not work.
PR#1609 adds unit tests for properly testing this case (previously only array returns where tested).
Furthermore, it patches the validation to detect such cases and rejects such SDFG, however, it is not a solution.
A true solution would allow that any (global) scalar can be used to pass information to the outside, as it is possible with arrays.
By dropping the return value annotation in the above code, the frontend would actually promote the return value to an array and it would work, but no scalar is returned then.
The text was updated successfully, but these errors were encountered:
It is impossible to return a scalar from an SDFG.
This is a code generator issue, as the final signature of the C function of
__return
is a scalar and not a pointer (okay calling it on the Python side must also be different then).The ability to return scalars is an intended behaviour, see
CompiledSDFG._convert_return_values()
that handles this case, but it does not work.PR#1609 adds unit tests for properly testing this case (previously only array returns where tested).
Furthermore, it patches the validation to detect such cases and rejects such SDFG, however, it is not a solution.
A true solution would allow that any (global) scalar can be used to pass information to the outside, as it is possible with arrays.
Code to reproduce:
By dropping the return value annotation in the above code, the frontend would actually promote the return value to an array and it would work, but no scalar is returned then.
The text was updated successfully, but these errors were encountered: