Skip to content

Allow print statements in kernels for debugging #336

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

Closed
cduck opened this issue Mar 26, 2025 · 0 comments · Fixed by #342
Closed

Allow print statements in kernels for debugging #336

cduck opened this issue Mar 26, 2025 · 0 comments · Fixed by #342
Labels
enhancement New feature or request

Comments

@cduck
Copy link

cduck commented Mar 26, 2025

Something like this:

@kernel.add(kirin.dialects.debug_print)
def my_function(arg):
    if arg:
        print("Did it work?")

Ideally, the message outputs to stdout whenever an interpreter interprets the function.

@cduck cduck added the enhancement New feature or request label Mar 26, 2025
Roger-luo added a commit that referenced this issue Mar 31, 2025
closes #336 printing this PR adds a new dialect named `debug` to model
possible debug related operations, right now this dialect only has an
`info` statement that prints a message and optionally some variables
feed after the message. Similar to `icecream` we will detect the name of
the variable and print the name and value pair of the variable. See
below for the printing


![image](https://github.com/user-attachments/assets/f28eb254-9276-401c-a23f-27a2910948bf)

cc: @cduck
Roger-luo added a commit that referenced this issue Mar 31, 2025
closes #336 printing this PR adds a new dialect named `debug` to model
possible debug related operations, right now this dialect only has an
`info` statement that prints a message and optionally some variables
feed after the message. Similar to `icecream` we will detect the name of
the variable and print the name and value pair of the variable. See
below for the printing


![image](https://github.com/user-attachments/assets/f28eb254-9276-401c-a23f-27a2910948bf)

cc: @cduck
Roger-luo added a commit that referenced this issue Apr 5, 2025
closes #336 printing this PR adds a new dialect named `debug` to model
possible debug related operations, right now this dialect only has an
`info` statement that prints a message and optionally some variables
feed after the message. Similar to `icecream` we will detect the name of
the variable and print the name and value pair of the variable. See
below for the printing


![image](https://github.com/user-attachments/assets/f28eb254-9276-401c-a23f-27a2910948bf)

cc: @cduck
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant