Skip to content

Commit e821972

Browse files
committed
add the batching frontend
1 parent aa8f0fd commit e821972

File tree

5 files changed

+225
-127
lines changed

5 files changed

+225
-127
lines changed

compiler/rustc_ast/src/expand/autodiff_attrs.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ pub struct AutoDiffAttrs {
7777
/// e.g. in the [JAX
7878
/// Documentation](https://jax.readthedocs.io/en/latest/_tutorials/advanced-autodiff.html#how-it-s-made-two-foundational-autodiff-functions).
7979
pub mode: DiffMode,
80+
pub width: u32,
8081
pub ret_activity: DiffActivity,
8182
pub input_activity: Vec<DiffActivity>,
8283
}
@@ -222,13 +223,15 @@ impl AutoDiffAttrs {
222223
pub const fn error() -> Self {
223224
AutoDiffAttrs {
224225
mode: DiffMode::Error,
226+
width: 0,
225227
ret_activity: DiffActivity::None,
226228
input_activity: Vec::new(),
227229
}
228230
}
229231
pub fn source() -> Self {
230232
AutoDiffAttrs {
231233
mode: DiffMode::Source,
234+
width: 0,
232235
ret_activity: DiffActivity::None,
233236
input_activity: Vec::new(),
234237
}

compiler/rustc_builtin_macros/messages.ftl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ builtin_macros_autodiff_ret_activity = invalid return activity {$act} in {$mode}
7979
builtin_macros_autodiff_ty_activity = {$act} can not be used for this type
8080
builtin_macros_autodiff_unknown_activity = did not recognize Activity: `{$act}`
8181
82+
builtin_macros_autodiff_width = autodiff width must fit u32, but is {$width}
8283
builtin_macros_bad_derive_target = `derive` may only be applied to `struct`s, `enum`s and `union`s
8384
.label = not applicable here
8485
.label2 = not a `struct`, `enum` or `union`

0 commit comments

Comments
 (0)