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

incorrect derivative of function that returns struct #1894

Open
samuelpmish opened this issue May 20, 2024 · 2 comments
Open

incorrect derivative of function that returns struct #1894

samuelpmish opened this issue May 20, 2024 · 2 comments

Comments

@samuelpmish
Copy link
Collaborator

https://fwd.gymni.ch/vKIfPx

It seems like some versions of clang are getting the right answers, but others aren't

@samuelpmish
Copy link
Collaborator Author

Update: I was asked to try refactoring the wrapper to return by-reference instead of by-value, but that doesn't seem to have changed the output:

https://fwd.gymni.ch/qIWjto

It's also worth noting that I may just be using __enzyme_fwddiff incorrectly!

@samuelpmish
Copy link
Collaborator Author

I showed this to @jandrej and he noticed an important detail: the results are correct when compiling with -O2, but incorrect without it, so maybe it's another inlining issue (and if so, which functions should be forced to inline?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant