diff --git a/apps/linear_algebra/benchmarks/halide_benchmarks.cpp b/apps/linear_algebra/benchmarks/halide_benchmarks.cpp index e150fa840253..528f8ed9ea70 100644 --- a/apps/linear_algebra/benchmarks/halide_benchmarks.cpp +++ b/apps/linear_algebra/benchmarks/halide_benchmarks.cpp @@ -14,7 +14,7 @@ #include "clock.h" #include "halide_blas.h" #include "macros.h" -#include +#include #include #include #include @@ -82,6 +82,9 @@ struct BenchmarksBase { bench_gemm_transB(size); } else if (benchmark == "gemm_transAB") { bench_gemm_transAB(size); + } else { + std::cerr << "subroutine: <" << benchmark << "> not known\n"; + std::exit(1); } } @@ -159,8 +162,8 @@ struct BenchmarksDouble : public BenchmarksBase { int main(int argc, char *argv[]) { if (argc != 3) { - std::cout << "USAGE: halide_benchmarks \n"; - return 0; + std::cerr << "USAGE: halide_benchmarks \n"; + return 1; } std::string subroutine = argv[1]; @@ -172,6 +175,9 @@ int main(int argc, char *argv[]) { BenchmarksFloat("Halide").run(subroutine, size); } else if (type == 'd') { BenchmarksDouble("Halide").run(subroutine, size); + } else { + std::cerr << "type: '" << type << "' not known. Expected 's' or 'd'.\n"; + return 1; } return 0;