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
#![feature(autodiff)]use std::autodiff::autodiff;fnmain(){#[autodiff(d_inner, Forward, Dual, DualOnly)]fninner(x:f32) -> f32{
x * x
}}
build results in the error message (with the first line with the path manually removed)
error: autodiff must be applied to function
--> src/main.rs:6:5
|
6 | / fn inner(x: f32) -> f32 {
7 | | x * x
8 | | }
| |_____^
error: could not compile `enzyme-test` (bin "enzyme-test") due to 1 previous error
The text was updated successfully, but these errors were encountered:
Thanks for the issue report! I'm a bit short on time till Nov 15, but will look at it afterwards.
That being said it's a frontend error, and those are usually easy to fix.
Here is the PR where I merged the frontend logic: https://github.com/rust-lang/rust/pull/129458/files#diff-548c9b1b2ceb2091452377c3716d4fe1b707295b33705834a97ce4274eb82afa
The error should be in compiler/rustc_builtin_macros/src/autodiff.rs, you probably need to look at the match statements which as fallback lead to this error and add the one case that matches this inner function (and is currently not getting matched).
But otherwise I can also add handling for it after my deadlines.
output of
rustc +enzyme --version --verbose
:rustc 1.84.0-nightly (1203575 2024-10-30)
binary: rustc
commit-hash: 1203575
commit-date: 2024-10-30
host: x86_64-unknown-linux-gnu
release: 1.84.0-nightly
LLVM version: 19.1.1
an example:
build results in the error message (with the first line with the path manually removed)
The text was updated successfully, but these errors were encountered: