Skip to content

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

Merged
zvookin merged 4 commits intomainfrom
vector_printer
Feb 7, 2024
Merged

Add an easy way to print vectors in debug output.#8072
zvookin merged 4 commits intomainfrom
vector_printer

Conversation

@zvookin
Copy link
Copy Markdown
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.

Comment thread src/Debug.h Outdated
@steven-johnson
Copy link
Copy Markdown
Contributor

Failures unrelated.

@zvookin zvookin merged commit 55dfa39 into main Feb 7, 2024
@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