Skip to content

Commit 99e9147

Browse files
committed
Add enzyme_autodiff doc comment
1 parent d12683c commit 99e9147

File tree

1 file changed

+11
-0
lines changed
  • library/core/src/intrinsics

1 file changed

+11
-0
lines changed

library/core/src/intrinsics/mod.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3157,6 +3157,17 @@ pub const unsafe fn copysignf64(x: f64, y: f64) -> f64;
31573157
#[rustc_intrinsic]
31583158
pub const unsafe fn copysignf128(x: f128, y: f128) -> f128;
31593159

3160+
/// Generates the LLVM body for the automatic differentiation of `f` using Enzyme,
3161+
/// with `df` as the derivative function and `args` as its arguments.
3162+
///
3163+
/// Used internally as the body of `df` when expanding the `#[autodiff_forward]`
3164+
/// and `#[autodiff_reverse]` attribute macros.
3165+
///
3166+
/// Type Parameters:
3167+
/// - `F`: The original function to differentiate. Must be a function item.
3168+
/// - `G`: The derivative function. Must be a function item.
3169+
/// - `T`: A tuple of arguments passed to `df`.
3170+
/// - `R`: The return type of the derivative function.
31603171
#[rustc_nounwind]
31613172
#[rustc_intrinsic]
31623173
pub const fn enzyme_autodiff<F, G, T: crate::marker::Tuple, R>(f: F, df: G, args: T) -> R;

0 commit comments

Comments
 (0)