Skip to content

Commit 51b8d37

Browse files
committed
benchdnn: check for match
1 parent e004b5a commit 51b8d37

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/benchdnn/dnnl_common.hpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,9 @@ void check_correctness(const prb_t *prb, const std::vector<data_kind_t> &kinds,
603603

604604
// Replace engine kind for repro line from GPU to CPU.
605605
const auto eng_pos = res->prim_ref_repro.find("engine=gpu");
606-
res->prim_ref_repro[eng_pos + 7] = 'c'; // Replace `g` in `gpu` with `c`
606+
if (eng_pos != std::string::npos)
607+
// Replace `g` in `gpu` with `c`
608+
res->prim_ref_repro[eng_pos + 7] = 'c';
607609

608610
BENCHDNN_PRINT(
609611
0, "[PRIM_REF][REPRO]: %s\n", res->prim_ref_repro.c_str());

0 commit comments

Comments
 (0)