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

[Feature] Print to File #96

Open
zzzDavid opened this issue Jul 3, 2022 · 0 comments
Open

[Feature] Print to File #96

zzzDavid opened this issue Jul 3, 2022 · 0 comments
Assignees
Labels
feature Feature that requires significant code change

Comments

@zzzDavid
Copy link
Collaborator

zzzDavid commented Jul 3, 2022

This thread is to discuss how to implement printing to file in MLIR.

Motivation

when we run the simulation model (llvm target) of the accelerator, we want to dump traces of different kinds, e.g. instruction, memory, cache trace, etc. We are using printf along with some tags for different traces, and post-process to bucket traces to different files. It would be nice to allow users to provide the file descriptors for different traces.

Is it achievable?

I'm not 100% sure if it's doable. One possible way I want to try is to leverage LLVM's ability to call C functions. For example, we can call fprintf to do that, we just have to find a way to pass a file descriptor to it (which essentially is an integer).

It is probably similar to how print is implemented, but I'm not exactly sure how LLVM dialect calls C function and what C functions are available, so I need to find out with some trial and error.

@zzzDavid zzzDavid added the enhancement New feature or request label Jul 3, 2022
@zzzDavid zzzDavid self-assigned this Jul 3, 2022
@zzzDavid zzzDavid added feature Feature that requires significant code change and removed enhancement New feature or request labels Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature that requires significant code change
Projects
None yet
Development

No branches or pull requests

1 participant