Fix Cycles build error with latest TBB after recent changes

From changes in 869a46df29, ref D14454
This commit is contained in:
Brecht Van Lommel 2022-04-18 18:30:55 +02:00
parent ccd2e89d37
commit 41b3feea85
2 changed files with 12 additions and 2 deletions

View File

@ -355,8 +355,7 @@ void PathTrace::path_trace(RenderWork &render_work)
const int num_works = path_trace_works_.size();
tbb::task_group_context *tbb_ctx = tbb::task::self().group();
tbb_ctx->capture_fp_settings();
thread_capture_fp_settings();
tbb::parallel_for(0, num_works, [&](int i) {
const double work_start_time = time_dt();

View File

@ -25,6 +25,17 @@ CCL_NAMESPACE_BEGIN
using tbb::blocked_range;
using tbb::enumerable_thread_specific;
using tbb::parallel_for;
using tbb::parallel_for_each;
static inline void thread_capture_fp_settings()
{
#if TBB_INTERFACE_VERSION_MAJOR >= 12
tbb::task_group_context *ctx = tbb::task::current_context();
#else
tbb::task_group_context *ctx = tbb::task::self().group();
#endif
ctx->capture_fp_settings();
}
static inline void parallel_for_cancel()
{