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

Add an easy way to print vectors in debug output. #8072

Merged
merged 4 commits into from
Feb 7, 2024
Merged

Conversation

zvookin
Copy link
Member

@zvookin zvookin commented Feb 6, 2024

Allow wrapping vectors and vector like containers with ConPrint or ConPrintLn to pass to operator<< for use in Halide debug output.

Open to advice on naming. I am not aware of other idioms for this and end up writing quick loops to print values fairly frequently. There is a routine for doing this with std::vector<Function> in ScheduleFunctions.cpp as well.

Might need perfect forwarding support, but I don't think so.

src/Debug.h Outdated Show resolved Hide resolved
@steven-johnson
Copy link
Contributor

Failures unrelated.

@zvookin zvookin merged commit 55dfa39 into main Feb 7, 2024
18 of 19 checks passed
@zvookin zvookin deleted the vector_printer branch February 7, 2024 18:23
ardier pushed a commit to ardier/Halide-mutation that referenced this pull request Mar 3, 2024
* Add helper to print containers, or at least vectors, in debug info.

* Add documentation comments.

* Formatting.

* Name change.
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.

3 participants