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

Complain if signatures of the forward declaration and generated code mismatch #810

Open
vgvassilev opened this issue Mar 9, 2024 · 2 comments · May be fixed by #836
Open

Complain if signatures of the forward declaration and generated code mismatch #810

vgvassilev opened this issue Mar 9, 2024 · 2 comments · May be fixed by #836

Comments

@vgvassilev
Copy link
Owner

Clad builds a gradient with a specific signature. It also allows that gradient function signature to be forward-declared. However if both mismatch there are subtle crashes in CodeGen. We should detect such cases and issue an error if they are in the same translation unit:

For example,

//CHECK: void f_cond3_grad(double x, double c, clad::array_ref<double> _d_x, clad::array_ref<double> _d_c) {

returns void, but the forward declaration is:

double f_cond3_grad(double x, double c, clad::array_ref<double> _d_x, clad::array_ref<double> _d_y);

which leads to subtle issues.

vgvassilev added a commit that referenced this issue Mar 9, 2024
We should be able to diagnose these problems as reported in #810.
vgvassilev added a commit that referenced this issue Mar 9, 2024
We should be able to diagnose these problems as reported in #810.
vgvassilev added a commit that referenced this issue Mar 9, 2024
We should be able to diagnose these problems as reported in #810.
vgvassilev added a commit that referenced this issue Mar 9, 2024
We should be able to diagnose these problems as reported in #810.
vgvassilev added a commit that referenced this issue Mar 10, 2024
We should be able to diagnose these problems as reported in #810.
vgvassilev added a commit that referenced this issue Mar 10, 2024
We should be able to diagnose these problems as reported in #810.
vgvassilev added a commit that referenced this issue Mar 10, 2024
We should be able to diagnose these problems as reported in #810.
@kaushal-malpure
Copy link

Hi @vgvassilev ,
Can I contribute to this issue?

vgvassilev added a commit that referenced this issue Mar 10, 2024
We should be able to diagnose these problems as reported in #810.
@vgvassilev
Copy link
Owner Author

@kaushal-malpure, please select one issue and solve it, please do not write under every open issue.

vgvassilev added a commit that referenced this issue Mar 10, 2024
We should be able to diagnose these problems as reported in #810.
vgvassilev added a commit that referenced this issue Mar 10, 2024
We should be able to diagnose these problems as reported in #810.
vgvassilev added a commit that referenced this issue Mar 10, 2024
We should be able to diagnose these problems as reported in #810.
vgvassilev added a commit that referenced this issue Mar 10, 2024
We should be able to diagnose these problems as reported in #810.
vgvassilev added a commit that referenced this issue Mar 10, 2024
We should be able to diagnose these problems as reported in #810.
vgvassilev added a commit that referenced this issue Mar 10, 2024
We should be able to diagnose these problems as reported in #810.
vgvassilev added a commit that referenced this issue Mar 10, 2024
We should be able to diagnose these problems as reported in #810.
vgvassilev added a commit that referenced this issue Mar 13, 2024
We should be able to diagnose these problems as reported in #810.
vgvassilev added a commit that referenced this issue Mar 13, 2024
We should be able to diagnose these problems as reported in #810.
vgvassilev added a commit that referenced this issue Mar 13, 2024
We should be able to diagnose these problems as reported in #810.
vgvassilev added a commit that referenced this issue Mar 14, 2024
We should be able to diagnose these problems as reported in #810.
vgvassilev added a commit that referenced this issue Mar 14, 2024
We should be able to diagnose these problems as reported in #810.
vgvassilev added a commit that referenced this issue Mar 14, 2024
We should be able to diagnose these problems as reported in #810.
vgvassilev added a commit that referenced this issue Mar 14, 2024
We should be able to diagnose these problems as reported in #810.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants