Contributor
Mihail Mihov

Add support for consteval and constexpr functions in clad


Mentors
Vassil Vassilev, Vaibhav Thakkar
Organization
CERN-HSF
Technologies
llvm, c++, clang
Topics
compilers, Automatic Differentiation
Clad is a Clang library which allows automatic differentiation (AD) of functions. Clang provides the necessary facilities for code transformation. The AD library can differentiate non-trivial functions, to find a partial derivative for trivial cases. Newer C++ versions provide the constexpr and consteval specifiers, but currently Clad does not abide by them. The aim of this proposal is to ensure that Clad generated derivative functions follow the semantics of the original functions. Adding support will likely require a new interface for CladFunction's and changes in clad::differentiate and clad::gradient.