You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add -fclad-porting-hints to name missing custom derivatives.
When clad has no custom derivative for a function whose definition it
can see, it silently falls back to differentiating that definition,
descending into the library's internals (reference counting,
allocation, I/O). At a library boundary that is rarely intended and
often yields ill-formed or incorrect derivatives. The hard part of
teaching clad a new library is discovering which functions need a
custom derivative -- or a non-differentiable marker -- and with which
signature.
-fclad-porting-hints surfaces every such boundary. For each function
defined outside the main source file that clad differentiates by
cloning, it emits a remark naming the expected custom-derivative
signature and, for methods and constructors, the non-differentiable
marker to declare instead. The hint is a per-request flag propagated
to sub-requests, so the boundary function -- reached as a sub-request
during a gradient -- is covered. It changes no generated code and is
off by default.
The custom-derivatives guide documents the workflow, and the flag is
listed in -plugin-arg-clad -help.
0 commit comments