-
Notifications
You must be signed in to change notification settings - Fork 133
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
dace codegen issues #1391
Comments
* The syntax for the type annotations is slightly wrong. You should write |
Hi @alexnick83 Thanks for the comments. I just have one follow up on point 2, I tried both the JIT version and AOT versions and it seems like the deciding factor in the generated code is whether I set the arguments as Regarding the other points, it makes sense after you explain it, but it is confusing for beginners who may not be aware of such design decisions. |
Please note that standard Python syntax applies. To use AoT, you need to provide type annotations. |
Since all the questions have been answered, I am closing this issue. |
Describe the bug
There are a few issues I have about the C++ generated code for a simple matrix addition example from dace.
.dacecache/madd/src/cpu/madd.cpp: in the __dace_init_madd() function:
we have a pointer allocation with new but the lines of code following the allocation check for the value in the __result integer. Why is this the case? As I understand it, the new operator with nothrow returns a nullptr, in which case the check should be to see if the pointer (__state) is null or it should be a try_catch block to check for bad_alloc. What am I missing here?
.dacecache/madd/src/cpu/madd.cpp: in the __program_madd_internal() function:
In this case I see that the loop induction termination is set to M and N, but the internal matrix access is specialized to 10 (A[10*i + j] for example). Why is this the case? Why cant the matrix access also be based on the inputs (M, N)?
.dacecache/madd/sample/madd_main.cpp: in the main() function:
I see that the int M, N are set to 42, but the calloc() is specialized correctly to 10x10. Where does the 42 come from? Why is this not also 10?
To Reproduce
Steps to reproduce the behavior:
Version
I am using dace v0.14.4
Additional context
Script to reproduce behavior along with the generated code on my machine.
code_gen.zip
The text was updated successfully, but these errors were encountered: