Replies: 2 comments
-
Marking |
Beta Was this translation helpful? Give feedback.
-
Packing parameters like this should work. But you are clearly encountering some kind of bug here, which needs to be investigated. Enzyme inline can be used like so: |
Beta Was this translation helpful? Give feedback.
-
Hi team,
I have a function that accepts all the parameters in an array of pointers. The parameters are unpacked to be used. Like this:
This function is inside the derived part of program, and the interface passed to
__enzyme_autodiff
has clearly separated parameters.Is packing parameters like this safe for Enzyme? I found Enzyme outputs an incorrect result if I do this.
A more complete example is below.
icf
's gradient will be wrong. But unfortunately it is not a full program and I failed to make it smaller for reproducing. Once I embed the data inside the program (by separated arrays, and pack them into an array of pointers just in the program body), the result will be magically become correct. I guess this is because the pointer alias analysis can distinguish these arrays then by the embedded input.Is packing of parameters like this likely to be attributed to the incorrect result? If not, what else can be wrong?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions