incorrect derivative of function that returns struct
samuelpmish opened this issue · 2 comments
samuelpmish commented
It seems like some versions of clang are getting the right answers, but others aren't
samuelpmish commented
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:
It's also worth noting that I may just be using __enzyme_fwddiff
incorrectly!
samuelpmish commented
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?)