aports/community/opensubdiv/0002-Support-oneTBB-2021.patch
2022-10-25 14:48:26 +00:00

43 lines
1.1 KiB
Diff

From 0fd85db5a7806cb73055db86869a6b1d8e3dfecd Mon Sep 17 00:00:00 2001
From: Artur Sinila <freesoftware@logarithmus.dev>
Date: Sun, 25 Jul 2021 20:58:27 +0300
Subject: [PATCH 2/2] Support oneTBB 2021
---
opensubdiv/osd/tbbEvaluator.cpp | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/opensubdiv/osd/tbbEvaluator.cpp b/opensubdiv/osd/tbbEvaluator.cpp
index c98db9f..66c2ed5 100644
--- a/opensubdiv/osd/tbbEvaluator.cpp
+++ b/opensubdiv/osd/tbbEvaluator.cpp
@@ -25,7 +25,8 @@
#include "../osd/tbbEvaluator.h"
#include "../osd/tbbKernel.h"
-#include <tbb/task_scheduler_init.h>
+#define TBB_PREVIEW_GLOBAL_CONTROL true
+#include <tbb/global_control.h>
namespace OpenSubdiv {
namespace OPENSUBDIV_VERSION {
@@ -215,10 +216,11 @@ TbbEvaluator::Synchronize(void *) {
/* static */
void
TbbEvaluator::SetNumThreads(int numThreads) {
- if (numThreads == -1) {
- tbb::task_scheduler_init init;
- } else {
- tbb::task_scheduler_init init(numThreads);
+ if (numThreads != -1) {
+ tbb::global_control tbb_global_control(
+ tbb::global_control::max_allowed_parallelism,
+ numThreads
+ );
}
}
--
2.37.3