We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This is related to #961, only that now the dereferenced array is a parameter to the function.
Reproducer:
// Compile with clang++ -std=c++11 -fplugin=install/clad.so -I./install/include cladIssue.cxx -o cladIssue #include "clad/Differentiator/Differentiator.h" #include <iostream> #include <vector> double wrapper(double* params, double const* constants) { double c0 = *constants; return params[0] * c0; } int main() { auto diff = clad::differentiate(wrapper, "params[0]"); // doesn't work auto grad = clad::gradient(wrapper, "params"); // works! double x = 2.0; double y = 2.0; double result = 0.0; grad.execute(&x, &y, &result); std::cout << result << std::endl; std::cout << diff.execute(&x, &y) << std::endl; }
Compiler output:
error: indirection requires pointer operand ('int' invalid) 1 error generated.
I'm using LLVM and Clang 16 to build clad standalone (see #973).
The text was updated successfully, but these errors were encountered:
Fix pointer dereference in fwd mode
6bf7395
fixes vgvassilev#972
cddb7b5
5f8033b
ec62356
ef668c7
vaithak
Successfully merging a pull request may close this issue.
This is related to #961, only that now the dereferenced array is a parameter to the function.
Reproducer:
Compiler output:
I'm using LLVM and Clang 16 to build clad standalone (see #973).
The text was updated successfully, but these errors were encountered: