Skip to content

Commit f05013d

Browse files
committed
examples, tests: use non-throw API to finalize threads in TBB
In some cases the TBB finalize API cannot be completed successfully and throws an exception. Switching to non-throw API version until the issue is addressed in TBB.
1 parent ab7938f commit f05013d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

examples/example_utils.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ inline void finalize() {
7272
#ifdef DNNL_TBB_NEED_EXPLICIT_FINALIZE
7373
tbb::task_scheduler_handle handle
7474
= tbb::task_scheduler_handle {tbb::attach {}};
75-
tbb::finalize(handle);
75+
tbb::finalize(handle, std::nothrow);
7676
#endif
7777
}
7878

tests/test_thread.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ auto execute_in_thr_ctx(const thr_ctx_t &ctx, F &&f, Args_t &...args)
330330
inline void finalize_tbb() {
331331
oneapi::tbb::task_scheduler_handle handle
332332
= oneapi::tbb::task_scheduler_handle {oneapi::tbb::attach {}};
333-
oneapi::tbb::finalize(handle);
333+
oneapi::tbb::finalize(handle, std::nothrow);
334334
}
335335
#else
336336
inline void finalize_tbb() {};

0 commit comments

Comments
 (0)