Skip to content

Commit 3da46bb

Browse files
committed
tests: benchdnn: catch and print SYCL graph execution exceptions
1 parent 6d7c794 commit 3da46bb

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

tests/benchdnn/dnnl_common.cpp

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -389,13 +389,20 @@ int execute_and_wait(perf_function_t &exec_func, const dnnl_engine_t &engine,
389389
{sycl::ext::oneapi::experimental::property::graph::
390390
assume_buffer_outlives_graph {}}};
391391

392-
graph.begin_recording(queue);
393-
status = exec_func(stream, dnnl_args);
394-
graph.end_recording(queue);
395-
DNN_SAFE(dnnl_stream_wait(stream), CRIT);
396-
397-
auto exec = graph.finalize();
398-
queue.ext_oneapi_graph(exec).wait();
392+
try {
393+
graph.begin_recording(queue);
394+
status = exec_func(stream, dnnl_args);
395+
graph.end_recording(queue);
396+
DNN_SAFE(dnnl_stream_wait(stream), CRIT);
397+
398+
auto exec = graph.finalize();
399+
queue.ext_oneapi_graph(exec).wait();
400+
} catch (const sycl::exception &e) {
401+
BENCHDNN_PRINT(0, "%s %s\n",
402+
"[ERROR] SYCL graph execution exception:", e.what());
403+
if (res) res->state = FAILED;
404+
return FAIL;
405+
}
399406

400407
// SYCL graph feature completed submission and execution, no need to
401408
// have a regular run.

0 commit comments

Comments
 (0)