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

Handle fprintf in handleKnownCallDerivatives #1844

Merged
merged 1 commit into from
May 1, 2024
Merged

Handle fprintf in handleKnownCallDerivatives #1844

merged 1 commit into from
May 1, 2024

Conversation

sbrantq
Copy link
Member

@sbrantq sbrantq commented Apr 22, 2024

Noticed this when trying to run LULESH with __enzyme_autodiff. When compiling the following example with a fprintf, I got an error:Enzyme: No create nofree of empty function (fprintf) fprintf) at context: %3 = call i32 (%struct.__sFILE*, i8*, ...) @fprintf(%struct.__sFILE* noundef %2, i8* noundef getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)) #4 (fprintf) .

#include <cstdio>

extern double __enzyme_autodiff(void*, double);

double fn(double vec) {
  fprintf(stderr, "test");
  return vec * vec;
}

int main() {
    double x = 2.1;
    __enzyme_autodiff((void*)fn, x);
}

Not sure if this is the best fix, though!

@sbrantq sbrantq marked this pull request as ready for review April 22, 2024 10:13
@sbrantq sbrantq requested a review from wsmoses April 22, 2024 10:13
@wsmoses wsmoses enabled auto-merge May 1, 2024 21:12
@wsmoses wsmoses added this pull request to the merge queue May 1, 2024
Merged via the queue into main with commit cbccccf May 1, 2024
32 of 46 checks passed
@wsmoses wsmoses deleted the fprintf branch May 1, 2024 22:03
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

Successfully merging this pull request may close these issues.

2 participants