Add catch blocks in example GEMM apps to enable better error handling (Issue: 1928) (#2234)

* added catch statements to examples

* clang format
This commit is contained in:
Aviral Goel
2025-05-28 00:32:42 -05:00
committed by GitHub
parent 132bd5b874
commit c52649ad57
6 changed files with 69 additions and 15 deletions

View File

@@ -319,4 +319,15 @@ float grouped_gemm(const std::vector<grouped_gemm_kargs>& gemm_descs,
#include "run_grouped_gemm_example.inc"
constexpr bool Persistent = false;
int main(int argc, char* argv[]) { return !run_grouped_gemm_example<Persistent>(argc, argv); }
int main(int argc, char* argv[])
{
try
{
return !run_grouped_gemm_example<Persistent>(argc, argv);
}
catch(const std::runtime_error& e)
{
std::cerr << "Runtime error: " << e.what() << '\n';
return EXIT_FAILURE;
}
}