diff --git a/tests/benchdnn/graph/bench_graph.cpp b/tests/benchdnn/graph/bench_graph.cpp index de0e5a4e121..21144a38533 100644 --- a/tests/benchdnn/graph/bench_graph.cpp +++ b/tests/benchdnn/graph/bench_graph.cpp @@ -36,8 +36,8 @@ void check_correctness(const settings_t &s) { BENCHDNN_PRINT(7, "[INFO] Graph dump:\n%s\n", dg.get_string().c_str()); const prb_t prb(dg); - const auto &cpp_pstr - = case_to_str(s.json_file, i_in_shapes, i_op_attrs, i_mb); + const auto &cpp_pstr = case_to_str( + s.json_file, i_in_shapes, i_op_attrs, i_fpmath_mode, i_mb); const char *pstr = cpp_pstr.c_str(); BENCHDNN_PRINT(1, "run: %s\n", pstr); res_t res {}; diff --git a/tests/benchdnn/graph/graph.cpp b/tests/benchdnn/graph/graph.cpp index 3ef71a29a77..72f9ad9fbba 100644 --- a/tests/benchdnn/graph/graph.cpp +++ b/tests/benchdnn/graph/graph.cpp @@ -340,7 +340,8 @@ using namespace dnnl::graph; std::string case_to_str(const std::string &json_file, const std::map &in_shapes, - const std::map &op_attrs, const int64_t mb) { + const std::map &op_attrs, + const std::string &fpmath_mode, const int64_t mb) { std::stringstream s; dump_global_params(s); @@ -369,6 +370,10 @@ std::string case_to_str(const std::string &json_file, s << " "; } + if (strcmp(fpmath_mode.c_str(), "default") != 0) { + s << "--attr-fpmath=" << fpmath_mode << " "; + } + s << "--case=" << json_file; return s.str(); } diff --git a/tests/benchdnn/graph/graph.hpp b/tests/benchdnn/graph/graph.hpp index a43f326902c..3d0ef6be739 100644 --- a/tests/benchdnn/graph/graph.hpp +++ b/tests/benchdnn/graph/graph.hpp @@ -74,7 +74,8 @@ struct prb_t { std::string case_to_str(const std::string &json_file, const std::map &in_shapes, - const std::map &op_attrs, const int64_t mb); + const std::map &op_attrs, + const std::string &fpmath_mode, const int64_t mb); struct perf_report_t : public base_perf_report_t { perf_report_t(const std::string case_str, const char *perf_template)