clad icon indicating copy to clipboard operation
clad copied to clipboard

Add support for pointers in TBR analysis.

Open vaithak opened this issue 1 year ago • 1 comments

We have recently added pointer support in reverse mode (#686), but the tests are currently failing when trying to run with the enable-tbr flag. The test file is test/Gadient/Pointers.C.

vaithak avatar Dec 29 '23 08:12 vaithak

One example which fails in current TBR analysis:

double pointerParam(const double* arr, size_t n) {
  double sum = 0;
  for (size_t i=0; i < n; ++i) {
    size_t* j = &i;
    sum += arr[0] * (*j);
    arr = arr + 1;
  }
  return sum;
}

vaithak avatar Jan 09 '24 10:01 vaithak