Skip to content

Commit

Permalink
examples, tests: use non-throw API to finalize threads in TBB
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
densamoilov committed Jan 20, 2023
1 parent ab7938f commit f05013d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/example_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ inline void finalize() {
#ifdef DNNL_TBB_NEED_EXPLICIT_FINALIZE
tbb::task_scheduler_handle handle
= tbb::task_scheduler_handle {tbb::attach {}};
tbb::finalize(handle);
tbb::finalize(handle, std::nothrow);
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion tests/test_thread.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ auto execute_in_thr_ctx(const thr_ctx_t &ctx, F &&f, Args_t &...args)
inline void finalize_tbb() {
oneapi::tbb::task_scheduler_handle handle
= oneapi::tbb::task_scheduler_handle {oneapi::tbb::attach {}};
oneapi::tbb::finalize(handle);
oneapi::tbb::finalize(handle, std::nothrow);
}
#else
inline void finalize_tbb() {};
Expand Down

0 comments on commit f05013d

Please sign in to comment.