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

eprintln! thread error #139

Closed
jpmedinagl opened this issue Jul 25, 2024 · 3 comments
Closed

eprintln! thread error #139

jpmedinagl opened this issue Jul 25, 2024 · 3 comments

Comments

@jpmedinagl
Copy link
Collaborator

jpmedinagl commented Jul 25, 2024

When trying to autodiff a function that has the eprintln! macro, there is an error:

error: <unknown>:0:0: in function preprocess_eprintfunc void (): Enzyme: No create nofree of unknown value
@__cxa_thread_atexit_impl = extern_weak global i8
 at context:   call void @_ZN3std2io5stdio7_eprint17h1ff923295f510774E(ptr noalias nocapture noundef nonnull align 8 dereferenceable(48) %1) #110

I tried creating a minimal reproducible with ENZYME_OPT=1 and llvm-extract for the enzyme explorer (out.txt) but the explorer gives a slightly different error

error: <unknown>:0:0: in function preprocess__ZN3std2io5stdio31print_to_buffer_if_capture_used17hf768171844a00e61E i1 (ptr): Enzyme: cannot compute with global variable that doesn't have marked shadow global
@_ZN3std2io5stdio14OUTPUT_CAPTURE7__getit5__KEY17h15828b3e0884a413E.llvm.11955502528429326793 = external hidden thread_local global <{ [8 x i8], [8 x i8], [1 x i8], [7 x i8] }>, align 8

Not sure if its the same error.

Below is the rust file and cargo. Generated the error with cargo +enzyme build --release --bin file

#![feature(autodiff)]

#[no_mangle]
#[autodiff(diff, Reverse)]
fn eprintfunc() {
    eprintln!("eprintln error");
}

fn main() {
    diff();
}
[package]
name = "lib"
version = "0.1.0"
edition = "2021"

[profile.release]
lto = "fat"

[[bin]]
name = "file"
path = "file.rs"
@wsmoses
Copy link
Member

wsmoses commented Jul 25, 2024 via email

@ZuseZ4
Copy link
Member

ZuseZ4 commented Jul 25, 2024

@ZuseZ4
Copy link
Member

ZuseZ4 commented Jul 29, 2024

closed by EnzymeAD/Enzyme#2022

@ZuseZ4 ZuseZ4 closed this as completed Jul 29, 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

3 participants