clad icon indicating copy to clipboard operation
clad copied to clipboard

clad -- automatic differentiation for C/C++

Results 301 clad issues
Sort by recently updated
recently updated
newest added

Minimum reproducible example: ```cpp void h(float a, float output[]){ output[0]=a*a; output[1]=output[0]*3; } int main(){ auto dh = clad::jacobian(h); float a=3; float output[2]={0}; float jc[2]={0}; dh.execute(a,output,jc); printf("Result = {%.2f, %.2f}",jc[0],jc[1]); }...

Minimum reproducible example: ```cpp void h(float a, float output[]){ output[1]=a; output[0]=a*a; } int main(){ auto dh = clad::jacobian(h); float a=3; float output[2]={0}; float jc[2]={0}; dh.execute(a,output,jc); printf("Result = {%.2f, %.2f}",jc[0],jc[1]); }...

Now One must be able to find the Jacobian of functions with Constant Arrays in the parameter list. For example, a function of the form: ```cpp void func(double arr[3], double...

For functions of type ```double myfunction(double* arr){...};``` OR ```double myfunction(double arr[3]){...};``` we generate derivative code of type: ``` void d_myfunction(double* arr, clad::array_ref _d_arr){ double* d_arr = _d_arr.ptr(); __enzyme_autodiff_myfunction(myfunction, arr, d_arr);...

Here is the function: ```cpp double x2_integral(double lower, double upper){ double sum=0; double interval = 0.001; for(double x=lower;x

Input: ```cpp struct CamInfo { float projM[16]; float width; float height; }; void VertexShader(const CamInfo& u, float vx, float vy, float vz, float output[2]) { const float W = vx...

Hello! I took an example of jacobian from main page (h). If i make the first parameter array, clad crashes :( Input: ```cpp //void h(float a, float b, float output[])...

Hi I'm successfully using clad, but cannot use estimate_error: Can someone help me? C++17clad C++14clad C++11clad standard clad tutorial ``` #include "clad/Differentiator/Differentiator.h" float function_fn1(float x, float y) { float z;...

Minimum reproducible example: ```cpp int bar(double *width) { return 0; } double foo(double x) { double arr[3] = {0, 1, 2}; double sum = 0; for (int i = 0;...

Currently, we are having MACROs that makes writing tests easier in most of the test files. We should have unified testing utilities that can be included in any test file...