@@ -1519,20 +1519,41 @@ pub(crate) mod builtin {
1519
1519
( $file: expr $( , ) ?) => { { /* compiler built-in */ } } ;
1520
1520
}
1521
1521
1522
- /// Automatic Differentiation macro which allows generating a new function to compute
1523
- /// the derivative of a given function. It may only be applied to a function.
1524
- /// The expected usage syntax is
1525
- /// `#[autodiff(NAME, MODE, INPUT_ACTIVITIES, OUTPUT_ACTIVITY)]`
1526
- /// where:
1527
- /// NAME is a string that represents a valid function name.
1528
- /// MODE is any of Forward, Reverse, ForwardFirst, ReverseFirst.
1529
- /// INPUT_ACTIVITIES consists of one valid activity for each input parameter.
1530
- /// OUTPUT_ACTIVITY must not be set if we implicitly return nothing (or explicitly return
1531
- /// `-> ()`). Otherwise it must be set to one of the allowed activities.
1522
+ /// This macro uses forward-mode automatic differentiation to generate a new function.
1523
+ /// It may only be applied to a function. The new function will compute the derivative
1524
+ /// of the function to which the macro was applied.
1525
+ ///
1526
+ /// The expected usage syntax is:
1527
+ /// `#[autodiff_forward(NAME, INPUT_ACTIVITIES, OUTPUT_ACTIVITY)]`
1528
+ ///
1529
+ /// - `NAME`: A string that represents a valid function name.
1530
+ /// - `INPUT_ACTIVITIES`: Specifies one valid activity for each input parameter.
1531
+ /// - `OUTPUT_ACTIVITY`: Must not be set if the function implicitly returns nothing
1532
+ /// (or explicitly returns `-> ()`). Otherwise, it must be set to one of the allowed activities.
1533
+ #[ unstable( feature = "autodiff" , issue = "124509" ) ]
1534
+ #[ allow_internal_unstable( rustc_attrs) ]
1535
+ #[ rustc_builtin_macro]
1536
+ #[ cfg( not( bootstrap) ) ]
1537
+ pub macro autodiff_forward( $item: item) {
1538
+ /* compiler built-in */
1539
+ }
1540
+
1541
+ /// This macro uses reverse-mode automatic differentiation to generate a new function.
1542
+ /// It may only be applied to a function. The new function will compute the derivative
1543
+ /// of the function to which the macro was applied.
1544
+ ///
1545
+ /// The expected usage syntax is:
1546
+ /// `#[autodiff_reverse(NAME, INPUT_ACTIVITIES, OUTPUT_ACTIVITY)]`
1547
+ ///
1548
+ /// - `NAME`: A string that represents a valid function name.
1549
+ /// - `INPUT_ACTIVITIES`: Specifies one valid activity for each input parameter.
1550
+ /// - `OUTPUT_ACTIVITY`: Must not be set if the function implicitly returns nothing
1551
+ /// (or explicitly returns `-> ()`). Otherwise, it must be set to one of the allowed activities.
1532
1552
#[ unstable( feature = "autodiff" , issue = "124509" ) ]
1533
1553
#[ allow_internal_unstable( rustc_attrs) ]
1534
1554
#[ rustc_builtin_macro]
1535
- pub macro autodiff( $item: item) {
1555
+ #[ cfg( not( bootstrap) ) ]
1556
+ pub macro autodiff_reverse( $item: item) {
1536
1557
/* compiler built-in */
1537
1558
}
1538
1559
0 commit comments