diff options
-rw-r--r-- | intern/cycles/integrator/path_trace.cpp | 3 | ||||
-rw-r--r-- | intern/cycles/util/tbb.h | 11 |
2 files changed, 12 insertions, 2 deletions
diff --git a/intern/cycles/integrator/path_trace.cpp b/intern/cycles/integrator/path_trace.cpp index f1e70b7f28f..6fddbf56edc 100644 --- a/intern/cycles/integrator/path_trace.cpp +++ b/intern/cycles/integrator/path_trace.cpp @@ -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(); diff --git a/intern/cycles/util/tbb.h b/intern/cycles/util/tbb.h index 7105ddda0f8..948bf2b3e0e 100644 --- a/intern/cycles/util/tbb.h +++ b/intern/cycles/util/tbb.h @@ -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() { |