Replies: 1 comment
-
Hi @Towdo
This would be difficult to implement because the array size information is typically lost when arrays are passed to functions as pointers. We need the array size information at compile-time to properly map derivatives in the output Jacobian matrix. For a concrete example, please consider the below case: void fn(double *x, double u, double *output) { ... } If Your current example should be easy to implement because the size information is preserved ( |
Beta Was this translation helpful? Give feedback.
-
Hey,
I'm wondering if it might be possible to have array inputs for functions passed to
clad::jacobian
in the future.So instead of the following example, which is taken from the README:
I'd like to have:
Currently, this does cause the following error:
clang-18: /home/llvm/include/llvm/ADT/SmallVector.h:304: T& llvm::SmallVectorTemplateCommon<T, <template-parameter-1-2> >::operator[](size_type) [with T = const clang::ValueDecl*; <template-parameter-1-2> = void; reference = const clang::ValueDecl*&; size_type = long unsigned int]: Assertion "idx < size()" failed.
Is this something that might be possible in the future, or is there something inherently stopping us from achieving this?
Beta Was this translation helpful? Give feedback.
All reactions