Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong error message for using the wrong macro "style" for the autodiff macro #185

Open
sYgbpNA5UEVufjsHNwF3Xvf9ANZi5bNs opened this issue Nov 5, 2024 · 0 comments

Comments

@sYgbpNA5UEVufjsHNwF3Xvf9ANZi5bNs

rustc +enzyme -vV output:

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

example:

#![feature(autodiff)]
use std::autodiff::autodiff;

#[autodiff = "Forward"]
fn f(x: f32) -> f32 {
    x * x
}
#[autodiff]
fn g(x: f32) -> f32 {
    x * x
}

fn main() {}

complilation error:

error: autodiff must be applied to function
 --> src/main.rs:5:1
  |
5 | / fn f(x: f32) -> f32 {
6 | |     x * x
7 | | }
  | |_^

error: autodiff must be applied to function
  --> src/main.rs:9:1
   |
9  | / fn g(x: f32) -> f32 {
10 | |     x * x
11 | | }
   | |_^

error: could not compile `enzyme-test` (bin "enzyme-test") due to 2 previous errors

while both are wrong the error message stating the macro must be applied to functions only doesn't make sense here.

I don't know how the macro styles like #[foo] as opposed to #[foo(Bar)] are referred to hence the "style" in the title

@sYgbpNA5UEVufjsHNwF3Xvf9ANZi5bNs sYgbpNA5UEVufjsHNwF3Xvf9ANZi5bNs changed the title Wrong error message for using the wrong macro "style" Wrong error message for using the wrong macro "style" for the autodiff macro Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant