You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a function that takes in some arrays of data and their sizes, processes that data, then returns a couple of arrays and their length (the size of the arrays returned are not known at compile time). I'd like to write a custom rule for the forward mode derivative of this function, but I haven't been able to figure out the syntax when the derivative is called inside another function.
I've tried using the return value to return the size of the arrays, but this caused a crash in clang 15 (see https://fwd.gymni.ch/Kca0sM for a simplified example).
I've also passed in the array size int as a pointer. This works when calling __enzyme_fwddiff() directly on the function, but when I call __enzyme_fwddiff() on another function that then calls this function, the custom rule is ignored (see a simplified example at https://fwd.gymni.ch/snIxLG).
I’ve found a few workarounds to get it working for now (switch the int for a double or initialize with magic numbers before calling the function), but I’d really appreciate some help finding a more natural way to do this.
The text was updated successfully, but these errors were encountered:
I have a function that takes in some arrays of data and their sizes, processes that data, then returns a couple of arrays and their length (the size of the arrays returned are not known at compile time). I'd like to write a custom rule for the forward mode derivative of this function, but I haven't been able to figure out the syntax when the derivative is called inside another function.
I've tried using the return value to return the size of the arrays, but this caused a crash in clang 15 (see https://fwd.gymni.ch/Kca0sM for a simplified example).
I've also passed in the array size int as a pointer. This works when calling
__enzyme_fwddiff()
directly on the function, but when I call__enzyme_fwddiff()
on another function that then calls this function, the custom rule is ignored (see a simplified example at https://fwd.gymni.ch/snIxLG).I’ve found a few workarounds to get it working for now (switch the int for a double or initialize with magic numbers before calling the function), but I’d really appreciate some help finding a more natural way to do this.
The text was updated successfully, but these errors were encountered: