Skip to content

Conversation

@FabianSchuetze
Copy link
Contributor

The change notify users that a wrong subroutine argument is given. Currently class such as halide_benchmarks sgemm 1024 return immediately without a message.

@alexreinking
Copy link
Member

Happy to merge this, but I'm curious how you encountered it? Normally, we run these tests via CTest.

@FabianSchuetze
Copy link
Contributor Author

Thanks, @alexreinking, for the encouragement.

I think Halide's apps are a gem, and I use them often.

After building the linalg app, I just typed halide_benchmarks sgemm 1024 and forgot to _notrans specifier. The app then outputs nothing, and I would have appreciated short feedback (especially as the main function of the app already provides feedback).

@mcourteaux
Copy link
Contributor

Shouldn't we print to cerr to catch this in ctest, or at least exit with status code 1?

@FabianSchuetze
Copy link
Contributor Author

Good point about the output stream. My first inclination was to use cerr, but I did otherwise to keep symmetry with the main function.

The return code would also be interesting. I didn't do it to avoid refactoring too many functions in the call stack.

Happy to implement any of your suggestions, Martijn, though.

@alexreinking
Copy link
Member

alexreinking commented Jul 2, 2025

Shouldn't we print to cerr to catch this in ctest, or at least exit with status code 1?

Yeah, I think printing to std::cerr and calling abort(); is the right behavior here. While we're looking at this, why don't we also validate the char type value in main? There should be a final else branch down there.

@alexreinking alexreinking self-assigned this Aug 13, 2025
Copy link
Member

@alexreinking alexreinking left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry this took so long to get in. Our buildbots have been on fire for a while

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