pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
openvdb: Update to release 9.1.0
Module Name: pkgsrc-wip
Committed By: Paul Ripke <stix%stix.id.au@localhost>
Pushed By: stix
Date: Fri Jun 10 12:25:41 2022 +1000
Changeset: 8ca80846cb520a9cd925614d40ed0a8787ab45b1
Modified Files:
openvdb/Makefile
openvdb/PLIST
openvdb/distinfo
Removed Files:
openvdb/patches/patch-cmake_FindTBB.cmake
openvdb/patches/patch-openvdb__houdini_openvdb__houdini_SOP__OpenVDB__Rasterize__Points.cc
openvdb/patches/patch-openvdb__houdini_openvdb__houdini_SOP__OpenVDB__Sample__Points.cc
openvdb/patches/patch-openvdb_openvdb_CMakeLists.txt
openvdb/patches/patch-openvdb_openvdb_cmd_openvdb__render.cc
openvdb/patches/patch-openvdb_openvdb_io_Queue.cc
openvdb/patches/patch-openvdb_openvdb_math_Coord.h
openvdb/patches/patch-openvdb_openvdb_points_PointSample.h
openvdb/patches/patch-openvdb_openvdb_tools_Composite.h
openvdb/patches/patch-openvdb_openvdb_tools_Diagnostics.h
openvdb/patches/patch-openvdb_openvdb_tools_Filter.h
openvdb/patches/patch-openvdb_openvdb_tools_GridOperators.h
openvdb/patches/patch-openvdb_openvdb_tools_LevelSetMeasure.h
openvdb/patches/patch-openvdb_openvdb_tools_LevelSetTracker.h
openvdb/patches/patch-openvdb_openvdb_tools_MeshToVolume.h
openvdb/patches/patch-openvdb_openvdb_tools_Morphology.h
openvdb/patches/patch-openvdb_openvdb_tools_ParticlesToLevelSet.h
openvdb/patches/patch-openvdb_openvdb_tools_PointAdvect.h
openvdb/patches/patch-openvdb_openvdb_tools_PointIndexGrid.h
openvdb/patches/patch-openvdb_openvdb_tools_PointPartitioner.h
openvdb/patches/patch-openvdb_openvdb_tools_PointsToMask.h
openvdb/patches/patch-openvdb_openvdb_tools_VolumeAdvect.h
openvdb/patches/patch-openvdb_openvdb_tools_VolumeToMesh.h
openvdb/patches/patch-openvdb_openvdb_unittest_TestCoord.cc
openvdb/patches/patch-openvdb_openvdb_unittest_TestFile.cc
openvdb/patches/patch-openvdb_openvdb_unittest_TestUtil.cc
openvdb/patches/patch-openvdb_openvdb_unittest_TestValueAccessor.cc
openvdb/patches/patch-openvdb_openvdb_util_Threading.h
Log Message:
openvdb: Update to release 9.1.0
Highlights of the release:
- Added multiple new rasterization methods for particle to volume operations
to generate both surfaces and fog volumes.
- OpenVDB AX support on Windows.
- Added support for AMD's HIP API in NanoVDB.
- Various other bug fixes, improvements and new features.
Full release notes:
https://www.openvdb.org/documentation/doxygen/changes.html#v9_1_0_changes
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=8ca80846cb520a9cd925614d40ed0a8787ab45b1
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
openvdb/Makefile | 2 +-
openvdb/PLIST | 13 +-
openvdb/distinfo | 34 +----
openvdb/patches/patch-cmake_FindTBB.cmake | 50 -------
...vdb__houdini_SOP__OpenVDB__Rasterize__Points.cc | 33 -----
...penvdb__houdini_SOP__OpenVDB__Sample__Points.cc | 67 ---------
.../patches/patch-openvdb_openvdb_CMakeLists.txt | 15 --
.../patch-openvdb_openvdb_cmd_openvdb__render.cc | 38 -----
openvdb/patches/patch-openvdb_openvdb_io_Queue.cc | 162 ---------------------
openvdb/patches/patch-openvdb_openvdb_math_Coord.h | 17 ---
.../patch-openvdb_openvdb_points_PointSample.h | 36 -----
.../patch-openvdb_openvdb_tools_Composite.h | 15 --
.../patch-openvdb_openvdb_tools_Diagnostics.h | 72 ---------
.../patches/patch-openvdb_openvdb_tools_Filter.h | 52 -------
.../patch-openvdb_openvdb_tools_GridOperators.h | 40 -----
.../patch-openvdb_openvdb_tools_LevelSetMeasure.h | 47 ------
.../patch-openvdb_openvdb_tools_LevelSetTracker.h | 55 -------
.../patch-openvdb_openvdb_tools_MeshToVolume.h | 63 --------
.../patch-openvdb_openvdb_tools_Morphology.h | 25 ----
...tch-openvdb_openvdb_tools_ParticlesToLevelSet.h | 58 --------
.../patch-openvdb_openvdb_tools_PointAdvect.h | 50 -------
.../patch-openvdb_openvdb_tools_PointIndexGrid.h | 24 ---
.../patch-openvdb_openvdb_tools_PointPartitioner.h | 25 ----
.../patch-openvdb_openvdb_tools_PointsToMask.h | 39 -----
.../patch-openvdb_openvdb_tools_VolumeAdvect.h | 39 -----
.../patch-openvdb_openvdb_tools_VolumeToMesh.h | 25 ----
.../patch-openvdb_openvdb_unittest_TestCoord.cc | 18 ---
.../patch-openvdb_openvdb_unittest_TestFile.cc | 56 -------
.../patch-openvdb_openvdb_unittest_TestUtil.cc | 15 --
...h-openvdb_openvdb_unittest_TestValueAccessor.cc | 78 ----------
.../patches/patch-openvdb_openvdb_util_Threading.h | 58 --------
31 files changed, 15 insertions(+), 1306 deletions(-)
diffs:
diff --git a/openvdb/Makefile b/openvdb/Makefile
index 4dcfd30018..552f97222e 100644
--- a/openvdb/Makefile
+++ b/openvdb/Makefile
@@ -1,7 +1,7 @@
# $NetBSD$
DISTNAME= openvdb-${PKGVERSION}
-PKGVERSION= 8.1.0
+PKGVERSION= 9.1.0
CATEGORIES= devel
MASTER_SITES= ${MASTER_SITE_GITHUB:=AcademySoftwareFoundation/}
GITHUB_PROJECT= openvdb
diff --git a/openvdb/PLIST b/openvdb/PLIST
index 7a67c457cb..de01100746 100644
--- a/openvdb/PLIST
+++ b/openvdb/PLIST
@@ -58,9 +58,18 @@ include/openvdb/points/PointDelete.h
include/openvdb/points/PointGroup.h
include/openvdb/points/PointMask.h
include/openvdb/points/PointMove.h
+include/openvdb/points/PointRasterizeFrustum.h
+include/openvdb/points/PointRasterizeSDF.h
+include/openvdb/points/PointRasterizeTrilinear.h
include/openvdb/points/PointSample.h
include/openvdb/points/PointScatter.h
+include/openvdb/points/PointStatistics.h
+include/openvdb/points/PointTransfer.h
include/openvdb/points/StreamCompression.h
+include/openvdb/points/impl/PointRasterizeFrustumImpl.h
+include/openvdb/points/impl/PointRasterizeSDFImpl.h
+include/openvdb/points/impl/PointRasterizeTrilinearImpl.h
+include/openvdb/thread/Threading.h
include/openvdb/tools/Activate.h
include/openvdb/tools/ChangeBackground.h
include/openvdb/tools/Clip.h
@@ -126,13 +135,13 @@ include/openvdb/tree/Tree.h
include/openvdb/tree/TreeIterator.h
include/openvdb/tree/ValueAccessor.h
include/openvdb/util/CpuTimer.h
+include/openvdb/util/ExplicitInstantiation.h
include/openvdb/util/Formats.h
include/openvdb/util/MapsUtil.h
include/openvdb/util/Name.h
include/openvdb/util/NodeMasks.h
include/openvdb/util/NullInterrupter.h
include/openvdb/util/PagedArray.h
-include/openvdb/util/Threading.h
include/openvdb/util/Util.h
include/openvdb/util/logging.h
include/openvdb/version.h
@@ -149,5 +158,5 @@ lib/cmake/OpenVDB/OpenVDBMayaSetup.cmake
lib/cmake/OpenVDB/OpenVDBUtils.cmake
lib/libopenvdb.a
lib/libopenvdb.so
-lib/libopenvdb.so.8.1
+lib/libopenvdb.so.9.1
lib/libopenvdb.so.${PKGVERSION}
diff --git a/openvdb/distinfo b/openvdb/distinfo
index 82cb389ab5..4a4b360f86 100644
--- a/openvdb/distinfo
+++ b/openvdb/distinfo
@@ -1,33 +1,5 @@
$NetBSD$
-BLAKE2s (openvdb-8.1.0.tar.gz) = c77e0df037f13fd264b4bbd0db39468ebeaa83b7fb3d40e246c268f5576a99a6
-SHA512 (openvdb-8.1.0.tar.gz) = 081ccedb122ff9bd73e0cd7ff083ad0ff0165e0cf6305187edcbe90ff12f01ec085c91ad5c52c53596035e0c2afd5b8801e6c00374b0fc4b0cc111f5c7f37eb5
-Size (openvdb-8.1.0.tar.gz) = 2619432 bytes
-SHA1 (patch-cmake_FindTBB.cmake) = 4e5dee93840c8a1d8ce31583c6e875c7c7180268
-SHA1 (patch-openvdb__houdini_openvdb__houdini_SOP__OpenVDB__Rasterize__Points.cc) = d64161cac2347281e3b3dbf8ab34d38a3f92caa1
-SHA1 (patch-openvdb__houdini_openvdb__houdini_SOP__OpenVDB__Sample__Points.cc) = 1f185f9c4e9c32fffc27053a32294723d2364fb0
-SHA1 (patch-openvdb_openvdb_CMakeLists.txt) = 95068c5079daf3b285ed15d10dda2224042d3f17
-SHA1 (patch-openvdb_openvdb_cmd_openvdb__render.cc) = 5d2167a5c14fe5360f26dbcaca9f09ce94dabb23
-SHA1 (patch-openvdb_openvdb_io_Queue.cc) = 3a02113c6b07648af1b661c675212cd0790b2c86
-SHA1 (patch-openvdb_openvdb_math_Coord.h) = d261d2bf4c00f2cdf14b78f02f43d70c51761d99
-SHA1 (patch-openvdb_openvdb_points_PointSample.h) = 6785dc257378446b1caa95b04be1e5db10756b4d
-SHA1 (patch-openvdb_openvdb_tools_Composite.h) = c0bd2fd327682c49291933449b15716ae097958d
-SHA1 (patch-openvdb_openvdb_tools_Diagnostics.h) = 4f7ce9c442ea0e902b454467b7b03d75966abfd3
-SHA1 (patch-openvdb_openvdb_tools_Filter.h) = dd37877e5a7a1583fad2ed353bc4a8af657ef408
-SHA1 (patch-openvdb_openvdb_tools_GridOperators.h) = eac78c96cf36d2e856bc591a8adafc0b5c7e8986
-SHA1 (patch-openvdb_openvdb_tools_LevelSetMeasure.h) = 9c62e8fb16cf54ebf507315a1fe90af882cae4d8
-SHA1 (patch-openvdb_openvdb_tools_LevelSetTracker.h) = 1bad499c1b3b6cb66805455f5cba761fa0a774dd
-SHA1 (patch-openvdb_openvdb_tools_MeshToVolume.h) = b47f5ac643ceb9c32863a70bf9e5728b4adbe99f
-SHA1 (patch-openvdb_openvdb_tools_Morphology.h) = c9fed6e406035593c3c8212307fa3a689038c03a
-SHA1 (patch-openvdb_openvdb_tools_ParticlesToLevelSet.h) = ffeba2704012065592dcb29e38e8d0933348503e
-SHA1 (patch-openvdb_openvdb_tools_PointAdvect.h) = b74f2df8d0f41b6ad3c5e7a5fb4f49b4d7da49bb
-SHA1 (patch-openvdb_openvdb_tools_PointIndexGrid.h) = 113af065622c8d4cca89eb606561cc7888342acb
-SHA1 (patch-openvdb_openvdb_tools_PointPartitioner.h) = ce7b7ca3ccead1b2a31f4cc0e35cb22e11eee6e0
-SHA1 (patch-openvdb_openvdb_tools_PointsToMask.h) = 60c613290e4ea40e9c91954e566fe470e2b181ef
-SHA1 (patch-openvdb_openvdb_tools_VolumeAdvect.h) = 579fc1394af8c9fbbf156597bb027a4017968887
-SHA1 (patch-openvdb_openvdb_tools_VolumeToMesh.h) = 1d1615a4d1dc7c53be83e23b7a59aa3c987423e1
-SHA1 (patch-openvdb_openvdb_unittest_TestCoord.cc) = 3080befabc463c2ad18f3285248fac14eb3867e1
-SHA1 (patch-openvdb_openvdb_unittest_TestFile.cc) = a51f1fcd654b9072af8a21e4ba6d283939149b02
-SHA1 (patch-openvdb_openvdb_unittest_TestUtil.cc) = 064bf5cfb851983ca35c402d190a769e69b30729
-SHA1 (patch-openvdb_openvdb_unittest_TestValueAccessor.cc) = 3ef52d06678d52cc6699b3e73c82a2d997b700fb
-SHA1 (patch-openvdb_openvdb_util_Threading.h) = f688e5a1cbd13eecc25c07862dd31fdf3a1d5f7e
+BLAKE2s (openvdb-9.1.0.tar.gz) = e386567b6712d0df6b1f6497ccf43784a2aeafb48be8d87132c8ea9639d7adf1
+SHA512 (openvdb-9.1.0.tar.gz) = 434be61b03efec5d0022594d81064dce5f67595c1e34934d79e13627e573d2819bf947ca5b433fdca134642975b83eda71b46cf802f57e135d1611dbe2e5757e
+Size (openvdb-9.1.0.tar.gz) = 3107285 bytes
diff --git a/openvdb/patches/patch-cmake_FindTBB.cmake b/openvdb/patches/patch-cmake_FindTBB.cmake
deleted file mode 100644
index ba56f04bd4..0000000000
--- a/openvdb/patches/patch-cmake_FindTBB.cmake
+++ /dev/null
@@ -1,50 +0,0 @@
-$NetBSD$
-
-Support tbb 2021.3 from
-https://github.com/AcademySoftwareFoundation/openvdb/commit/5b0ec82307c603adb147cee4bc1a925d407141f5
-
---- cmake/FindTBB.cmake.orig 2021-06-11 21:38:41.000000000 +0000
-+++ cmake/FindTBB.cmake
-@@ -169,8 +169,22 @@ find_path(Tbb_INCLUDE_DIR tbb/tbb_stddef
- PATH_SUFFIXES ${CMAKE_INSTALL_INCLUDEDIR} include
- )
-
--if(EXISTS "${Tbb_INCLUDE_DIR}/tbb/tbb_stddef.h")
-- file(STRINGS "${Tbb_INCLUDE_DIR}/tbb/tbb_stddef.h"
-+set(_tbb_version_file "${Tbb_INCLUDE_DIR}/tbb/tbb_stddef.h")
-+
-+if(NOT EXISTS ${_tbb_version_file})
-+ # From TBB 2021, tbb_stddef is removed and the directory include/tbb is
-+ # simply an alias for include/oneapi/tbb. Try and find the version header
-+ # in oneapi/tbb
-+ find_path(Tbb_INCLUDE_DIR oneapi/tbb/version.h
-+ ${_FIND_TBB_ADDITIONAL_OPTIONS}
-+ PATHS ${_TBB_INCLUDE_SEARCH_DIRS}
-+ PATH_SUFFIXES ${CMAKE_INSTALL_INCLUDEDIR} include
-+ )
-+ set(_tbb_version_file "${Tbb_INCLUDE_DIR}/oneapi/tbb/version.h")
-+endif()
-+
-+if(EXISTS ${_tbb_version_file})
-+ file(STRINGS ${_tbb_version_file}
- _tbb_version_major_string REGEX "#define TBB_VERSION_MAJOR "
- )
- string(REGEX REPLACE "#define TBB_VERSION_MAJOR" ""
-@@ -178,7 +192,7 @@ if(EXISTS "${Tbb_INCLUDE_DIR}/tbb/tbb_st
- )
- string(STRIP "${_tbb_version_major_string}" Tbb_VERSION_MAJOR)
-
-- file(STRINGS "${Tbb_INCLUDE_DIR}/tbb/tbb_stddef.h"
-+ file(STRINGS ${_tbb_version_file}
- _tbb_version_minor_string REGEX "#define TBB_VERSION_MINOR "
- )
- string(REGEX REPLACE "#define TBB_VERSION_MINOR" ""
-@@ -192,6 +206,8 @@ if(EXISTS "${Tbb_INCLUDE_DIR}/tbb/tbb_st
- set(Tbb_VERSION ${Tbb_VERSION_MAJOR}.${Tbb_VERSION_MINOR})
- endif()
-
-+unset(_tbb_version_file)
-+
- # ------------------------------------------------------------------------
- # Search for TBB lib DIR
- # ------------------------------------------------------------------------
diff --git a/openvdb/patches/patch-openvdb__houdini_openvdb__houdini_SOP__OpenVDB__Rasterize__Points.cc b/openvdb/patches/patch-openvdb__houdini_openvdb__houdini_SOP__OpenVDB__Rasterize__Points.cc
deleted file mode 100644
index 60c141aa2b..0000000000
--- a/openvdb/patches/patch-openvdb__houdini_openvdb__houdini_SOP__OpenVDB__Rasterize__Points.cc
+++ /dev/null
@@ -1,33 +0,0 @@
-$NetBSD$
-
-Support tbb 2021.3 from
-https://github.com/AcademySoftwareFoundation/openvdb/commit/5b0ec82307c603adb147cee4bc1a925d407141f5
-
---- openvdb_houdini/openvdb_houdini/SOP_OpenVDB_Rasterize_Points.cc.orig 2021-06-11 21:38:41.000000000 +0000
-+++ openvdb_houdini/openvdb_houdini/SOP_OpenVDB_Rasterize_Points.cc
-@@ -20,6 +20,7 @@
- #include <openvdb/tools/GridTransformer.h>
- #include <openvdb/tools/PointIndexGrid.h>
- #include <openvdb/tools/Prune.h>
-+#include <openvdb/util/Threading.h>
-
- #include <CH/CH_Manager.h>
- #include <CVEX/CVEX_Context.h>
-@@ -786,7 +787,7 @@ struct ConstructCandidateVoxelMask
- for (size_t n = range.begin(), N = range.end(); n != N; ++n) {
-
- if (this->wasInterrupted()) {
-- tbb::task::self().cancel_group_execution();
-+ openvdb::util::cancelGroupExecution();
- break;
- }
-
-@@ -2092,7 +2093,7 @@ struct RasterizePoints
- for (size_t n = range.begin(), N = range.end(); n != N; ++n) {
-
- if (this->wasInterrupted()) {
-- tbb::task::self().cancel_group_execution();
-+ openvdb::util::cancelGroupExecution();
- break;
- }
-
diff --git a/openvdb/patches/patch-openvdb__houdini_openvdb__houdini_SOP__OpenVDB__Sample__Points.cc b/openvdb/patches/patch-openvdb__houdini_openvdb__houdini_SOP__OpenVDB__Sample__Points.cc
deleted file mode 100644
index 23e5463d83..0000000000
--- a/openvdb/patches/patch-openvdb__houdini_openvdb__houdini_SOP__OpenVDB__Sample__Points.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-$NetBSD$
-
-Support tbb 2021.3 from
-https://github.com/AcademySoftwareFoundation/openvdb/commit/5b0ec82307c603adb147cee4bc1a925d407141f5
-
---- openvdb_houdini/openvdb_houdini/SOP_OpenVDB_Sample_Points.cc.orig 2021-06-11 21:38:41.000000000 +0000
-+++ openvdb_houdini/openvdb_houdini/SOP_OpenVDB_Sample_Points.cc
-@@ -16,13 +16,11 @@
- #include <openvdb_houdini/SOP_NodeVDB.h>
-
- #include <openvdb/tools/Interpolation.h> // for box sampler
-+#include <openvdb/util/Threading.h>
- #include <openvdb/points/PointCount.h>
- #include <openvdb/points/PointSample.h>
- #include <openvdb/points/IndexFilter.h> // for MultiGroupFilter
-
--#include <tbb/tick_count.h> // for timing
--#include <tbb/task.h> // for cancel
--
- #include <UT/UT_Interrupt.h>
- #include <GA/GA_PageHandle.h>
- #include <GA/GA_PageIterator.h>
-@@ -38,6 +36,7 @@
- #include <stdexcept>
- #include <string>
- #include <vector>
-+#include <chrono>
-
-
-
-@@ -327,7 +326,7 @@ public:
- {
-
- if (mInterrupter->wasInterrupted()) {
-- tbb::task::self().cancel_group_execution();
-+ openvdb::util::cancelGroupExecution();
- }
- const GridType& grid = UTvdbGridCast<GridType>(mGrid);
- // task local grid accessor
-@@ -481,7 +480,7 @@ SOP_OpenVDB_Sample_Points::Cache::cookVD
- int numUnnamedGrids = 0;
-
- // start time
-- tbb::tick_count time_start = tbb::tick_count::now();
-+ auto time_start = std::chrono::steady_clock::now();
- UT_AutoInterrupt progress("Sampling from VDB grids");
-
- for (hvdb::VdbPrimCIterator it(bGdp, group); it; ++it) {
-@@ -707,14 +706,16 @@ SOP_OpenVDB_Sample_Points::Cache::cookVD
- }
-
- // timing: end time
-- tbb::tick_count time_end = tbb::tick_count::now();
-+ auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(
-+ std::chrono::steady_clock::now() - time_start);
-+ const double seconds = double(duration.count()) / 1000.0;
-
- if (verbose) {
- std::cout << "Sampling " << nPoints + nVDBPoints << " points in "
- << numVectorGrids << " vector grid" << (numVectorGrids == 1 ? "" : "s")
- << " and " << numScalarGrids << " scalar grid"
- << (numScalarGrids == 1 ? "" : "s")
-- << " took " << (time_end - time_start).seconds() << " seconds\n "
-+ << " took " << seconds << " seconds\n "
- << (threaded ? "threaded" : "non-threaded") << std::endl;
- }
-
diff --git a/openvdb/patches/patch-openvdb_openvdb_CMakeLists.txt b/openvdb/patches/patch-openvdb_openvdb_CMakeLists.txt
deleted file mode 100644
index 063b87d932..0000000000
--- a/openvdb/patches/patch-openvdb_openvdb_CMakeLists.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD$
-
-Support tbb 2021.3 from
-https://github.com/AcademySoftwareFoundation/openvdb/commit/5b0ec82307c603adb147cee4bc1a925d407141f5
-
---- openvdb/openvdb/CMakeLists.txt.orig 2021-06-11 21:38:41.000000000 +0000
-+++ openvdb/openvdb/CMakeLists.txt
-@@ -434,6 +434,7 @@ set(OPENVDB_LIBRARY_UTIL_INCLUDE_FILES
- util/NodeMasks.h
- util/NullInterrupter.h
- util/PagedArray.h
-+ util/Threading.h
- util/Util.h
- )
-
diff --git a/openvdb/patches/patch-openvdb_openvdb_cmd_openvdb__render.cc b/openvdb/patches/patch-openvdb_openvdb_cmd_openvdb__render.cc
deleted file mode 100644
index ff4118a7e4..0000000000
--- a/openvdb/patches/patch-openvdb_openvdb_cmd_openvdb__render.cc
+++ /dev/null
@@ -1,38 +0,0 @@
-$NetBSD$
-
-Support tbb 2021.3 from
-https://github.com/AcademySoftwareFoundation/openvdb/commit/5b0ec82307c603adb147cee4bc1a925d407141f5
-
---- openvdb/openvdb/cmd/openvdb_render.cc.orig 2021-06-11 21:38:41.000000000 +0000
-+++ openvdb/openvdb/cmd/openvdb_render.cc
-@@ -19,7 +19,14 @@
- #include <OpenEXR/ImfHeader.h>
- #include <OpenEXR/ImfOutputFile.h>
- #include <OpenEXR/ImfPixelType.h>
--#include <tbb/task_scheduler_init.h>
-+
-+// tbb/task_scheduler_init.h was removed in TBB 2021. The best construct to swap
-+// to is tbb/global_control (for executables). global_control was only officially
-+// added in TBB 2019U4 but exists in 2018 as a preview feature. To avoid more
-+// compile time branching (as we still support 2018), we use it in 2018 too by
-+// enabling the below define.
-+#define TBB_PREVIEW_GLOBAL_CONTROL
-+#include <tbb/global_control.h>
- #include <tbb/tick_count.h>
-
- #include <algorithm>
-@@ -606,8 +613,12 @@ main(int argc, char *argv[])
- }
-
- try {
-- tbb::task_scheduler_init schedulerInit(
-- (opts.threads == 0) ? tbb::task_scheduler_init::automatic : opts.threads);
-+ std::unique_ptr<tbb::global_control> control;
-+ if (opts.threads > 0) {
-+ // note, opts.threads == 0 means use all threads (default), so don't
-+ // manually create a tbb::global_control in this case
-+ control.reset(new tbb::global_control(tbb::global_control::max_allowed_parallelism, opts.threads));
-+ }
-
- openvdb::initialize();
-
diff --git a/openvdb/patches/patch-openvdb_openvdb_io_Queue.cc b/openvdb/patches/patch-openvdb_openvdb_io_Queue.cc
deleted file mode 100644
index 8ce9eb9e9e..0000000000
--- a/openvdb/patches/patch-openvdb_openvdb_io_Queue.cc
+++ /dev/null
@@ -1,162 +0,0 @@
-$NetBSD$
-
-Support tbb 2021.3 from
-https://github.com/AcademySoftwareFoundation/openvdb/commit/5b0ec82307c603adb147cee4bc1a925d407141f5
-
---- openvdb/openvdb/io/Queue.cc.orig 2021-06-11 21:38:41.000000000 +0000
-+++ openvdb/openvdb/io/Queue.cc
-@@ -5,20 +5,22 @@
- /// @author Peter Cucka
-
- #include "Queue.h"
--
- #include "File.h"
- #include "Stream.h"
--#include <openvdb/Exceptions.h>
--#include <openvdb/util/logging.h>
-+#include "openvdb/Exceptions.h"
-+#include "openvdb/util/logging.h"
-+
- #include <tbb/concurrent_hash_map.h>
--#include <tbb/task.h>
--#include <tbb/tbb_thread.h> // for tbb::this_tbb_thread::sleep()
--#include <tbb/tick_count.h>
-+#include <tbb/task_arena.h>
-+
-+#include <thread>
- #include <algorithm> // for std::max()
- #include <atomic>
- #include <iostream>
- #include <map>
- #include <mutex>
-+#include <chrono>
-+
-
- namespace openvdb {
- OPENVDB_USE_VERSION_NAMESPACE
-@@ -28,18 +30,19 @@ namespace io {
- namespace {
-
- // Abstract base class for queuable TBB tasks that adds a task completion callback
--class Task: public tbb::task
-+class Task
- {
- public:
- Task(Queue::Id id): mId(id) {}
-- ~Task() override {}
-+ virtual ~Task() {}
-
- Queue::Id id() const { return mId; }
-
- void setNotifier(Queue::Notifier& notifier) { mNotify = notifier; }
-+ virtual void execute() const = 0;
-
- protected:
-- void notify(Queue::Status status) { if (mNotify) mNotify(this->id(), status); }
-+ void notify(Queue::Status status) const { if (mNotify) mNotify(this->id(), status); }
-
- private:
- Queue::Id mId;
-@@ -48,7 +51,7 @@ private:
-
-
- // Queuable TBB task that writes one or more grids to a .vdb file or an output stream
--class OutputTask: public Task
-+class OutputTask : public Task
- {
- public:
- OutputTask(Queue::Id id, const GridCPtrVec& grids, const Archive& archive,
-@@ -56,10 +59,10 @@ public:
- : Task(id)
- , mGrids(grids)
- , mArchive(archive.copy())
-- , mMetadata(metadata)
-- {}
-+ , mMetadata(metadata) {}
-+ ~OutputTask() override {}
-
-- tbb::task* execute() override
-+ void execute() const override
- {
- Queue::Status status = Queue::FAILED;
- try {
-@@ -69,10 +72,8 @@ public:
- if (const char* msg = e.what()) {
- OPENVDB_LOG_ERROR(msg);
- }
-- } catch (...) {
-- }
-+ } catch (...) {}
- this->notify(status);
-- return nullptr; // no successor to this task
- }
-
- private:
-@@ -94,7 +95,6 @@ struct Queue::Impl
- /// @todo Provide more information than just "succeeded" or "failed"?
- using StatusMap = tbb::concurrent_hash_map<Queue::Id, Queue::Status>;
-
--
- Impl()
- : mTimeout(Queue::DEFAULT_TIMEOUT)
- , mCapacity(Queue::DEFAULT_CAPACITY)
-@@ -159,12 +159,15 @@ struct Queue::Impl
-
- bool canEnqueue() const { return mNumTasks < Int64(mCapacity); }
-
-- void enqueue(Task& task)
-+ void enqueue(OutputTask& task)
- {
-- tbb::tick_count start = tbb::tick_count::now();
-+ auto start = std::chrono::steady_clock::now();
- while (!canEnqueue()) {
-- tbb::this_tbb_thread::sleep(tbb::tick_count::interval_t(0.5/*sec*/));
-- if ((tbb::tick_count::now() - start).seconds() > double(mTimeout)) {
-+ std::this_thread::sleep_for(/*0.5s*/std::chrono::milliseconds(500));
-+ auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(
-+ std::chrono::steady_clock::now() - start);
-+ const double seconds = double(duration.count()) / 1000.0;
-+ if (seconds > double(mTimeout)) {
- OPENVDB_THROW(RuntimeError,
- "unable to queue I/O task; " << mTimeout << "-second time limit expired");
- }
-@@ -173,7 +176,10 @@ struct Queue::Impl
- std::placeholders::_1, std::placeholders::_2);
- task.setNotifier(notify);
- this->setStatus(task.id(), Queue::PENDING);
-- tbb::task::enqueue(task);
-+
-+ // get the global task arena
-+ tbb::task_arena arena(tbb::task_arena::attach{});
-+ arena.enqueue([task = std::move(task)] { task.execute(); });
- ++mNumTasks;
- }
-
-@@ -204,7 +210,7 @@ Queue::~Queue()
- /// (e.g., by keeping a static registry of queues that also dispatches
- /// or blocks notifications)?
- while (mImpl->mNumTasks > 0) {
-- tbb::this_tbb_thread::sleep(tbb::tick_count::interval_t(0.5/*sec*/));
-+ std::this_thread::sleep_for(/*0.5s*/std::chrono::milliseconds(500));
- }
- }
-
-@@ -290,16 +296,8 @@ Queue::Id
- Queue::writeGridVec(const GridCPtrVec& grids, const Archive& archive, const MetaMap& metadata)
- {
- const Queue::Id taskId = mImpl->mNextId++;
-- // From the "GUI Thread" chapter in the TBB Design Patterns guide
-- OutputTask* task =
-- new(tbb::task::allocate_root()) OutputTask(taskId, grids, archive, metadata);
-- try {
-- mImpl->enqueue(*task);
-- } catch (openvdb::RuntimeError&) {
-- // Destroy the task if it could not be enqueued, then rethrow the exception.
-- tbb::task::destroy(*task);
-- throw;
-- }
-+ OutputTask task(taskId, grids, archive, metadata);
-+ mImpl->enqueue(task);
- return taskId;
- }
-
diff --git a/openvdb/patches/patch-openvdb_openvdb_math_Coord.h b/openvdb/patches/patch-openvdb_openvdb_math_Coord.h
deleted file mode 100644
index 73fc1e9c3b..0000000000
--- a/openvdb/patches/patch-openvdb_openvdb_math_Coord.h
+++ /dev/null
@@ -1,17 +0,0 @@
-$NetBSD$
-
-Support tbb 2021.3 from
-https://github.com/AcademySoftwareFoundation/openvdb/commit/5b0ec82307c603adb147cee4bc1a925d407141f5
-
---- openvdb/openvdb/math/Coord.h.orig 2021-06-11 21:38:41.000000000 +0000
-+++ openvdb/openvdb/math/Coord.h
-@@ -13,8 +13,7 @@
- #include "Math.h"
- #include "Vec3.h"
-
--namespace tbb { class split; } // forward declaration
--
-+#include <tbb/blocked_range.h> // for tbb::split
-
- namespace openvdb {
- OPENVDB_USE_VERSION_NAMESPACE
diff --git a/openvdb/patches/patch-openvdb_openvdb_points_PointSample.h b/openvdb/patches/patch-openvdb_openvdb_points_PointSample.h
deleted file mode 100644
index 6ca5625a48..0000000000
--- a/openvdb/patches/patch-openvdb_openvdb_points_PointSample.h
+++ /dev/null
@@ -1,36 +0,0 @@
-$NetBSD$
-
-Support tbb 2021.3 from
-https://github.com/AcademySoftwareFoundation/openvdb/commit/5b0ec82307c603adb147cee4bc1a925d407141f5
-
---- openvdb/openvdb/points/PointSample.h.orig 2021-06-11 21:38:41.000000000 +0000
-+++ openvdb/openvdb/points/PointSample.h
-@@ -10,8 +10,9 @@
- #ifndef OPENVDB_POINTS_POINT_SAMPLE_HAS_BEEN_INCLUDED
- #define OPENVDB_POINTS_POINT_SAMPLE_HAS_BEEN_INCLUDED
-
--#include <openvdb/util/NullInterrupter.h>
--#include <openvdb/tools/Interpolation.h>
-+#include "openvdb/util/NullInterrupter.h"
-+#include "openvdb/util/Threading.h"
-+#include "openvdb/tools/Interpolation.h"
-
- #include "PointDataGrid.h"
- #include "PointAttribute.h"
-@@ -19,7 +20,6 @@
- #include <sstream>
- #include <type_traits>
-
--
- namespace openvdb {
- OPENVDB_USE_VERSION_NAMESPACE
- namespace OPENVDB_VERSION_NAME {
-@@ -299,7 +299,7 @@ private:
- using TargetHandleT = AttributeWriteHandle<typename SamplerWrapperT::ValueType>;
-
- if (util::wasInterrupted(interrupter)) {
-- tbb::task::self().cancel_group_execution();
-+ util::cancelGroupExecution();
- return;
- }
-
diff --git a/openvdb/patches/patch-openvdb_openvdb_tools_Composite.h b/openvdb/patches/patch-openvdb_openvdb_tools_Composite.h
deleted file mode 100644
index 72bf3cd9aa..0000000000
--- a/openvdb/patches/patch-openvdb_openvdb_tools_Composite.h
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD$
-
-Support tbb 2021.3 from
-https://github.com/AcademySoftwareFoundation/openvdb/commit/5b0ec82307c603adb147cee4bc1a925d407141f5
-
---- openvdb/openvdb/tools/Composite.h.orig 2021-06-11 21:38:41.000000000 +0000
-+++ openvdb/openvdb/tools/Composite.h
-@@ -24,7 +24,6 @@
- #include <tbb/parallel_for.h>
- #include <tbb/parallel_reduce.h>
- #include <tbb/task_group.h>
--#include <tbb/task_scheduler_init.h>
-
- #include <type_traits>
- #include <functional>
diff --git a/openvdb/patches/patch-openvdb_openvdb_tools_Diagnostics.h b/openvdb/patches/patch-openvdb_openvdb_tools_Diagnostics.h
deleted file mode 100644
index 0e4ca7cbf3..0000000000
--- a/openvdb/patches/patch-openvdb_openvdb_tools_Diagnostics.h
+++ /dev/null
@@ -1,72 +0,0 @@
-$NetBSD$
-
-Support tbb 2021.3 from
-https://github.com/AcademySoftwareFoundation/openvdb/commit/5b0ec82307c603adb147cee4bc1a925d407141f5
-
---- openvdb/openvdb/tools/Diagnostics.h.orig 2021-06-11 21:38:41.000000000 +0000
-+++ openvdb/openvdb/tools/Diagnostics.h
-@@ -11,14 +11,17 @@
- #ifndef OPENVDB_TOOLS_DIAGNOSTICS_HAS_BEEN_INCLUDED
- #define OPENVDB_TOOLS_DIAGNOSTICS_HAS_BEEN_INCLUDED
-
--#include <openvdb/Grid.h>
--#include <openvdb/math/Math.h>
--#include <openvdb/math/Vec3.h>
--#include <openvdb/math/Stencils.h>
--#include <openvdb/math/Operators.h>
--#include <openvdb/tree/LeafManager.h>
-+#include "openvdb/Grid.h"
-+#include "openvdb/math/Math.h"
-+#include "openvdb/math/Vec3.h"
-+#include "openvdb/math/Stencils.h"
-+#include "openvdb/math/Operators.h"
-+#include "openvdb/tree/LeafManager.h"
-+#include "openvdb/util/Threading.h"
-+
- #include <tbb/blocked_range.h>
- #include <tbb/parallel_reduce.h>
-+
- #include <cmath> // for std::isnan(), std::isfinite()
- #include <set>
- #include <sstream>
-@@ -26,7 +29,6 @@
- #include <type_traits>
- #include <vector>
-
--
- namespace openvdb {
- OPENVDB_USE_VERSION_NAMESPACE
- namespace OPENVDB_VERSION_NAME {
-@@ -1160,13 +1162,13 @@ InactiveVoxelValues<TreeType>::operator(
- {
- typename TreeType::LeafNodeType::ValueOffCIter iter;
-
-- for (size_t n = range.begin(); n < range.end() && !tbb::task::self().is_cancelled(); ++n) {
-+ for (size_t n = range.begin(); n < range.end() && !util::isGroupExecutionCancelled(); ++n) {
- for (iter = mLeafArray.leaf(n).cbeginValueOff(); iter; ++iter) {
- mInactiveValues.insert(iter.getValue());
- }
-
- if (mInactiveValues.size() > mNumValues) {
-- tbb::task::self().cancel_group_execution();
-+ util::cancelGroupExecution();
- }
- }
- }
-@@ -1250,14 +1252,14 @@ template<typename TreeType>
- inline void
- InactiveTileValues<TreeType>::operator()(IterRange& range)
- {
-- for (; range && !tbb::task::self().is_cancelled(); ++range) {
-+ for (; range && !util::isGroupExecutionCancelled(); ++range) {
- typename TreeType::ValueOffCIter iter = range.iterator();
- for (; iter; ++iter) {
- mInactiveValues.insert(iter.getValue());
- }
-
- if (mInactiveValues.size() > mNumValues) {
-- tbb::task::self().cancel_group_execution();
-+ util::cancelGroupExecution();
- }
- }
- }
diff --git a/openvdb/patches/patch-openvdb_openvdb_tools_Filter.h b/openvdb/patches/patch-openvdb_openvdb_tools_Filter.h
deleted file mode 100644
index 733db65dbb..0000000000
--- a/openvdb/patches/patch-openvdb_openvdb_tools_Filter.h
+++ /dev/null
@@ -1,52 +0,0 @@
-$NetBSD$
-
-Support tbb 2021.3 from
-https://github.com/AcademySoftwareFoundation/openvdb/commit/5b0ec82307c603adb147cee4bc1a925d407141f5
-
---- openvdb/openvdb/tools/Filter.h.orig 2021-06-11 21:38:41.000000000 +0000
-+++ openvdb/openvdb/tools/Filter.h
-@@ -14,21 +14,24 @@
- #ifndef OPENVDB_TOOLS_FILTER_HAS_BEEN_INCLUDED
- #define OPENVDB_TOOLS_FILTER_HAS_BEEN_INCLUDED
-
--#include <tbb/parallel_for.h>
--#include <openvdb/Types.h>
--#include <openvdb/math/Math.h>
--#include <openvdb/math/Stencils.h>
--#include <openvdb/math/Transform.h>
--#include <openvdb/tree/NodeManager.h>
--#include <openvdb/tree/LeafManager.h>
--#include <openvdb/util/NullInterrupter.h>
--#include <openvdb/util/Util.h>
--#include <openvdb/Grid.h>
-+#include "openvdb/Types.h"
-+#include "openvdb/Grid.h"
-+#include "openvdb/math/Math.h"
-+#include "openvdb/math/Stencils.h"
-+#include "openvdb/math/Transform.h"
-+#include "openvdb/tree/NodeManager.h"
-+#include "openvdb/tree/LeafManager.h"
-+#include "openvdb/util/NullInterrupter.h"
-+#include "openvdb/util/Util.h"
-+#include "openvdb/util/Threading.h"
- #include "Interpolation.h"
-+
-+#include <tbb/parallel_for.h>
-+#include <tbb/concurrent_vector.h>
-+
- #include <algorithm> // for std::max()
- #include <functional>
- #include <type_traits>
--#include <tbb/concurrent_vector.h>
-
- namespace openvdb {
- OPENVDB_USE_VERSION_NAMESPACE
-@@ -833,7 +836,7 @@ inline bool
- Filter<GridT, MaskT, InterruptT>::wasInterrupted()
- {
- if (util::wasInterrupted(mInterrupter)) {
-- tbb::task::self().cancel_group_execution();
-+ util::cancelGroupExecution();
- return true;
- }
- return false;
diff --git a/openvdb/patches/patch-openvdb_openvdb_tools_GridOperators.h b/openvdb/patches/patch-openvdb_openvdb_tools_GridOperators.h
deleted file mode 100644
index e3d1cfcb25..0000000000
--- a/openvdb/patches/patch-openvdb_openvdb_tools_GridOperators.h
+++ /dev/null
@@ -1,40 +0,0 @@
-$NetBSD$
-
-Support tbb 2021.3 from
-https://github.com/AcademySoftwareFoundation/openvdb/commit/5b0ec82307c603adb147cee4bc1a925d407141f5
-
---- openvdb/openvdb/tools/GridOperators.h.orig 2021-06-11 21:38:41.000000000 +0000
-+++ openvdb/openvdb/tools/GridOperators.h
-@@ -9,14 +9,15 @@
- #ifndef OPENVDB_TOOLS_GRID_OPERATORS_HAS_BEEN_INCLUDED
- #define OPENVDB_TOOLS_GRID_OPERATORS_HAS_BEEN_INCLUDED
-
--#include <openvdb/Grid.h>
--#include <openvdb/math/Operators.h>
--#include <openvdb/util/NullInterrupter.h>
--#include <openvdb/tree/LeafManager.h>
--#include <openvdb/tree/ValueAccessor.h>
-+#include "openvdb/Grid.h"
-+#include "openvdb/math/Operators.h"
-+#include "openvdb/util/NullInterrupter.h"
-+#include "openvdb/util/Threading.h"
-+#include "openvdb/tree/LeafManager.h"
-+#include "openvdb/tree/ValueAccessor.h"
- #include "ValueTransformer.h" // for tools::foreach()
--#include <tbb/parallel_for.h>
-
-+#include <tbb/parallel_for.h>
-
- namespace openvdb {
- OPENVDB_USE_VERSION_NAMESPACE
-@@ -383,7 +384,9 @@ public:
- /// TBB threads only!
- void operator()(const typename LeafManagerT::LeafRange& range) const
- {
-- if (util::wasInterrupted(mInterrupt)) tbb::task::self().cancel_group_execution();
-+ if (util::wasInterrupted(mInterrupt)) {
-+ util::cancelGroupExecution();
-+ }
-
- for (typename LeafManagerT::LeafRange::Iterator leaf=range.begin(); leaf; ++leaf) {
- for (typename OutLeafT::ValueOnIter value=leaf->beginValueOn(); value; ++value) {
diff --git a/openvdb/patches/patch-openvdb_openvdb_tools_LevelSetMeasure.h b/openvdb/patches/patch-openvdb_openvdb_tools_LevelSetMeasure.h
deleted file mode 100644
index c403196042..0000000000
--- a/openvdb/patches/patch-openvdb_openvdb_tools_LevelSetMeasure.h
+++ /dev/null
@@ -1,47 +0,0 @@
-$NetBSD$
-
-Support tbb 2021.3 from
-https://github.com/AcademySoftwareFoundation/openvdb/commit/5b0ec82307c603adb147cee4bc1a925d407141f5
-
---- openvdb/openvdb/tools/LevelSetMeasure.h.orig 2021-06-11 21:38:41.000000000 +0000
-+++ openvdb/openvdb/tools/LevelSetMeasure.h
-@@ -8,18 +8,21 @@
- #ifndef OPENVDB_TOOLS_LEVELSETMEASURE_HAS_BEEN_INCLUDED
- #define OPENVDB_TOOLS_LEVELSETMEASURE_HAS_BEEN_INCLUDED
-
--#include <openvdb/math/Math.h>
--#include <openvdb/Types.h>
--#include <openvdb/Grid.h>
--#include <openvdb/tree/LeafManager.h>
--#include <openvdb/tree/ValueAccessor.h>
--#include <openvdb/math/FiniteDifference.h>
--#include <openvdb/math/Operators.h>
--#include <openvdb/math/Stencils.h>
--#include <openvdb/util/NullInterrupter.h>
-+#include "openvdb/Types.h"
-+#include "openvdb/Grid.h"
-+#include "openvdb/tree/LeafManager.h"
-+#include "openvdb/tree/ValueAccessor.h"
-+#include "openvdb/math/Math.h"
-+#include "openvdb/math/FiniteDifference.h"
-+#include "openvdb/math/Operators.h"
-+#include "openvdb/math/Stencils.h"
-+#include "openvdb/util/NullInterrupter.h"
-+#include "openvdb/util/Threading.h"
-+
- #include <tbb/parallel_for.h>
- #include <tbb/parallel_sort.h>
- #include <tbb/parallel_invoke.h>
-+
- #include <type_traits>
-
- namespace openvdb {
-@@ -329,7 +332,7 @@ inline bool
- LevelSetMeasure<GridT, InterruptT>::checkInterrupter()
- {
- if (util::wasInterrupted(mInterrupter)) {
-- tbb::task::self().cancel_group_execution();
-+ util::cancelGroupExecution();
- return false;
- }
- return true;
diff --git a/openvdb/patches/patch-openvdb_openvdb_tools_LevelSetTracker.h b/openvdb/patches/patch-openvdb_openvdb_tools_LevelSetTracker.h
deleted file mode 100644
index fc3f0cae62..0000000000
--- a/openvdb/patches/patch-openvdb_openvdb_tools_LevelSetTracker.h
+++ /dev/null
@@ -1,55 +0,0 @@
-$NetBSD$
-
-Support tbb 2021.3 from
-https://github.com/AcademySoftwareFoundation/openvdb/commit/5b0ec82307c603adb147cee4bc1a925d407141f5
-
---- openvdb/openvdb/tools/LevelSetTracker.h.orig 2021-06-11 21:38:41.000000000 +0000
-+++ openvdb/openvdb/tools/LevelSetTracker.h
-@@ -12,24 +12,26 @@
- #ifndef OPENVDB_TOOLS_LEVEL_SET_TRACKER_HAS_BEEN_INCLUDED
- #define OPENVDB_TOOLS_LEVEL_SET_TRACKER_HAS_BEEN_INCLUDED
-
--#include <tbb/parallel_for.h>
--#include <openvdb/Types.h>
--#include <openvdb/math/Math.h>
--#include <openvdb/math/FiniteDifference.h>
--#include <openvdb/math/Operators.h>
--#include <openvdb/math/Stencils.h>
--#include <openvdb/math/Transform.h>
--#include <openvdb/Grid.h>
--#include <openvdb/util/NullInterrupter.h>
--#include <openvdb/tree/ValueAccessor.h>
--#include <openvdb/tree/LeafManager.h>
-+#include "openvdb/Types.h"
-+#include "openvdb/Grid.h"
-+#include "openvdb/math/Math.h"
-+#include "openvdb/math/FiniteDifference.h"
-+#include "openvdb/math/Operators.h"
-+#include "openvdb/math/Stencils.h"
-+#include "openvdb/math/Transform.h"
-+#include "openvdb/util/NullInterrupter.h"
-+#include "openvdb/util/Threading.h"
-+#include "openvdb/tree/ValueAccessor.h"
-+#include "openvdb/tree/LeafManager.h"
- #include "ChangeBackground.h"// for changeLevelSetBackground
- #include "Morphology.h"//for dilateActiveValues
- #include "Prune.h"// for pruneLevelSet
-+
-+#include <tbb/parallel_for.h>
-+
- #include <functional>
- #include <type_traits>
-
--
- namespace openvdb {
- OPENVDB_USE_VERSION_NAMESPACE
- namespace OPENVDB_VERSION_NAME {
-@@ -383,7 +385,7 @@ LevelSetTracker<GridT, InterruptT>::
- checkInterrupter()
- {
- if (util::wasInterrupted(mInterrupter)) {
-- tbb::task::self().cancel_group_execution();
-+ util::cancelGroupExecution();
- return false;
- }
- return true;
diff --git a/openvdb/patches/patch-openvdb_openvdb_tools_MeshToVolume.h b/openvdb/patches/patch-openvdb_openvdb_tools_MeshToVolume.h
deleted file mode 100644
index bb060b5b14..0000000000
--- a/openvdb/patches/patch-openvdb_openvdb_tools_MeshToVolume.h
+++ /dev/null
@@ -1,63 +0,0 @@
-$NetBSD$
-
-Support tbb 2021.3 from
-https://github.com/AcademySoftwareFoundation/openvdb/commit/5b0ec82307c603adb147cee4bc1a925d407141f5
-
---- openvdb/openvdb/tools/MeshToVolume.h.orig 2021-06-11 21:38:41.000000000 +0000
-+++ openvdb/openvdb/tools/MeshToVolume.h
-@@ -16,12 +16,13 @@
- #ifndef OPENVDB_TOOLS_MESH_TO_VOLUME_HAS_BEEN_INCLUDED
- #define OPENVDB_TOOLS_MESH_TO_VOLUME_HAS_BEEN_INCLUDED
-
--#include <openvdb/Platform.h> // for OPENVDB_HAS_CXX11
--#include <openvdb/Types.h>
--#include <openvdb/math/FiniteDifference.h> // for GodunovsNormSqrd
--#include <openvdb/math/Proximity.h> // for closestPointOnTriangleToPoint
--#include <openvdb/util/NullInterrupter.h>
--#include <openvdb/util/Util.h>
-+#include "openvdb/Platform.h" // for OPENVDB_HAS_CXX11
-+#include "openvdb/Types.h"
-+#include "openvdb/math/FiniteDifference.h" // for GodunovsNormSqrd
-+#include "openvdb/math/Proximity.h" // for closestPointOnTriangleToPoint
-+#include "openvdb/util/NullInterrupter.h"
-+#include "openvdb/util/Util.h"
-+#include "openvdb/util/Threading.h"
-
- #include "ChangeBackground.h"
- #include "Prune.h" // for pruneInactive and pruneLevelSet
-@@ -33,7 +34,7 @@
- #include <tbb/parallel_reduce.h>
- #include <tbb/partitioner.h>
- #include <tbb/task_group.h>
--#include <tbb/task_scheduler_init.h>
-+#include <tbb/task_arena.h>
-
- #include <algorithm> // for std::sort()
- #include <cmath> // for std::isfinite(), std::isnan()
-@@ -1132,7 +1133,7 @@ inline void
- fillArray(ValueType* array, const ValueType val, const size_t length)
- {
- const auto grainSize = std::max<size_t>(
-- length / tbb::task_scheduler_init::default_num_threads(), 1024);
-+ length / tbb::this_task_arena::max_concurrency(), 1024);
- const tbb::blocked_range<size_t> range(0, length, grainSize);
- tbb::parallel_for(range, FillArray<ValueType>(array, val), tbb::simple_partitioner());
- }
-@@ -1989,7 +1990,7 @@ public:
- for (size_t n = range.begin(), N = range.end(); n < N; ++n) {
-
- if (this->wasInterrupted()) {
-- tbb::task::self().cancel_group_execution();
-+ util::cancelGroupExecution();
- break;
- }
-
-@@ -2143,7 +2144,7 @@ private:
-
- while (!coordList.empty()) {
- if (interrupter && interrupter->wasInterrupted()) {
-- tbb::task::self().cancel_group_execution();
-+ util::cancelGroupExecution();
- break;
- }
- for (Int32 pass = 0; pass < 1048576 && !coordList.empty(); ++pass) {
diff --git a/openvdb/patches/patch-openvdb_openvdb_tools_Morphology.h b/openvdb/patches/patch-openvdb_openvdb_tools_Morphology.h
deleted file mode 100644
index 07460cc931..0000000000
--- a/openvdb/patches/patch-openvdb_openvdb_tools_Morphology.h
+++ /dev/null
@@ -1,25 +0,0 @@
-$NetBSD$
-
-Support tbb 2021.3 from
-https://github.com/AcademySoftwareFoundation/openvdb/commit/5b0ec82307c603adb147cee4bc1a925d407141f5
-
---- openvdb/openvdb/tools/Morphology.h.orig 2021-06-11 21:38:41.000000000 +0000
-+++ openvdb/openvdb/tools/Morphology.h
-@@ -24,7 +24,7 @@
- #include "openvdb/tree/ValueAccessor.h"
- #include "openvdb/tree/LeafManager.h"
-
--#include <tbb/task_scheduler_init.h>
-+#include <tbb/task_arena.h>
- #include <tbb/enumerable_thread_specific.h>
- #include <tbb/parallel_for.h>
-
-@@ -726,7 +726,7 @@ void Morphology<TreeType>::dilateVoxels(
- }
-
- // @note this grain size is used for optimal threading
-- const size_t numThreads = size_t(tbb::task_scheduler_init::default_num_threads());
-+ const size_t numThreads = size_t(tbb::this_task_arena::max_concurrency());
- const size_t subTreeSize = math::Max(size_t(1), array.size()/(2*numThreads));
-
- // perform recursive dilation to sub trees
diff --git a/openvdb/patches/patch-openvdb_openvdb_tools_ParticlesToLevelSet.h b/openvdb/patches/patch-openvdb_openvdb_tools_ParticlesToLevelSet.h
deleted file mode 100644
index c7e72c8b70..0000000000
--- a/openvdb/patches/patch-openvdb_openvdb_tools_ParticlesToLevelSet.h
+++ /dev/null
@@ -1,58 +0,0 @@
-$NetBSD$
-
-Support tbb 2021.3 from
-https://github.com/AcademySoftwareFoundation/openvdb/commit/5b0ec82307c603adb147cee4bc1a925d407141f5
-
---- openvdb/openvdb/tools/ParticlesToLevelSet.h.orig 2021-06-11 21:38:41.000000000 +0000
-+++ openvdb/openvdb/tools/ParticlesToLevelSet.h
-@@ -62,19 +62,23 @@
- #ifndef OPENVDB_TOOLS_PARTICLES_TO_LEVELSET_HAS_BEEN_INCLUDED
- #define OPENVDB_TOOLS_PARTICLES_TO_LEVELSET_HAS_BEEN_INCLUDED
-
--#include <tbb/parallel_reduce.h>
--#include <tbb/blocked_range.h>
--#include <openvdb/Types.h>
--#include <openvdb/Grid.h>
--#include <openvdb/math/Math.h>
--#include <openvdb/math/Transform.h>
--#include <openvdb/tree/LeafManager.h>
--#include <openvdb/util/logging.h>
--#include <openvdb/util/NullInterrupter.h>
-+#include "openvdb/Types.h"
-+#include "openvdb/Grid.h"
-+#include "openvdb/math/Math.h"
-+#include "openvdb/math/Transform.h"
-+#include "openvdb/tree/LeafManager.h"
-+#include "openvdb/util/logging.h"
-+#include "openvdb/util/NullInterrupter.h"
-+#include "openvdb/util/Threading.h"
-+
- #include "Composite.h" // for csgUnion()
- #include "PointPartitioner.h"
- #include "Prune.h"
- #include "SignedFloodFill.h"
-+
-+#include <tbb/parallel_reduce.h>
-+#include <tbb/blocked_range.h>
-+
- #include <functional>
- #include <iostream>
- #include <type_traits>
-@@ -738,7 +742,7 @@ private:
- for (Coord c = lo; c.x() <= hi.x(); ++c.x()) {
- //only check interrupter every 32'th scan in x
- if (!(count++ & ((1<<5)-1)) && util::wasInterrupted(mParent.mInterrupter)) {
-- tbb::task::self().cancel_group_execution();
-+ util::cancelGroupExecution();
- return false;
- }
- const Real x2 = math::Pow2(c.x() - P[0]);
-@@ -804,7 +808,7 @@ private:
- // Densely fill the remaining regions.
- for (const auto& bbox: padding) {
- if (util::wasInterrupted(mParent.mInterrupter)) {
-- tbb::task::self().cancel_group_execution();
-+ util::cancelGroupExecution();
- return false;
- }
- const Coord &bmin = bbox.min(), &bmax = bbox.max();
diff --git a/openvdb/patches/patch-openvdb_openvdb_tools_PointAdvect.h b/openvdb/patches/patch-openvdb_openvdb_tools_PointAdvect.h
deleted file mode 100644
index a9325f06f0..0000000000
--- a/openvdb/patches/patch-openvdb_openvdb_tools_PointAdvect.h
+++ /dev/null
@@ -1,50 +0,0 @@
-$NetBSD$
-
-Support tbb 2021.3 from
-https://github.com/AcademySoftwareFoundation/openvdb/commit/5b0ec82307c603adb147cee4bc1a925d407141f5
-
---- openvdb/openvdb/tools/PointAdvect.h.orig 2021-06-11 21:38:41.000000000 +0000
-+++ openvdb/openvdb/tools/PointAdvect.h
-@@ -10,16 +10,19 @@
- #ifndef OPENVDB_TOOLS_POINT_ADVECT_HAS_BEEN_INCLUDED
- #define OPENVDB_TOOLS_POINT_ADVECT_HAS_BEEN_INCLUDED
-
--#include <openvdb/openvdb.h>
--#include <openvdb/math/Math.h> // min
--#include <openvdb/Types.h> // Vec3 types and version number
--#include <openvdb/Grid.h> // grid
--#include <openvdb/util/NullInterrupter.h>
-+#include "openvdb/openvdb.h"
-+#include "openvdb/Types.h" // Vec3 types and version number
-+#include "openvdb/Grid.h" // grid
-+#include "openvdb/math/Math.h" // min
-+#include "openvdb/util/NullInterrupter.h"
-+#include "openvdb/util/Threading.h"
- #include "Interpolation.h" // sampling
- #include "VelocityFields.h" // VelocityIntegrator
-+
- #include <tbb/blocked_range.h> // threading
- #include <tbb/parallel_for.h> // threading
- #include <tbb/task.h> // for cancel
-+
- #include <vector>
-
-
-@@ -167,7 +170,7 @@ public:
- void operator() (const tbb::blocked_range<size_t> &range) const
- {
- if (mInterrupter && mInterrupter->wasInterrupted()) {
-- tbb::task::self().cancel_group_execution();
-+ util::cancelGroupExecution();
- }
-
- VelocityFieldIntegrator velField(*mVelGrid);
-@@ -307,7 +310,7 @@ public:
- void operator() (const tbb::blocked_range<size_t> &range) const
- {
- if (mInterrupter && mInterrupter->wasInterrupted()) {
-- tbb::task::self().cancel_group_execution();
-+ util::cancelGroupExecution();
- }
-
- VelocityIntegratorType velField(*mVelGrid);
diff --git a/openvdb/patches/patch-openvdb_openvdb_tools_PointIndexGrid.h b/openvdb/patches/patch-openvdb_openvdb_tools_PointIndexGrid.h
deleted file mode 100644
index d569e2f4dd..0000000000
--- a/openvdb/patches/patch-openvdb_openvdb_tools_PointIndexGrid.h
+++ /dev/null
@@ -1,24 +0,0 @@
-$NetBSD$
-
-Support tbb 2021.3 from
-https://github.com/AcademySoftwareFoundation/openvdb/commit/5b0ec82307c603adb147cee4bc1a925d407141f5
-
---- openvdb/openvdb/tools/PointIndexGrid.h.orig 2021-06-11 21:38:41.000000000 +0000
-+++ openvdb/openvdb/tools/PointIndexGrid.h
-@@ -16,6 +16,7 @@
- #ifndef OPENVDB_TOOLS_POINT_INDEX_GRID_HAS_BEEN_INCLUDED
- #define OPENVDB_TOOLS_POINT_INDEX_GRID_HAS_BEEN_INCLUDED
-
-+#include "openvdb/util/Threading.h"
- #include "PointPartitioner.h"
-
- #include <openvdb/version.h>
-@@ -355,7 +356,7 @@ struct ValidPartitioningOp
- void operator()(LeafT &leaf, size_t /*leafIndex*/) const
- {
- if ((*mHasChanged)) {
-- tbb::task::self().cancel_group_execution();
-+ util::cancelGroupExecution();
- return;
- }
-
diff --git a/openvdb/patches/patch-openvdb_openvdb_tools_PointPartitioner.h b/openvdb/patches/patch-openvdb_openvdb_tools_PointPartitioner.h
deleted file mode 100644
index c802be5267..0000000000
--- a/openvdb/patches/patch-openvdb_openvdb_tools_PointPartitioner.h
+++ /dev/null
@@ -1,25 +0,0 @@
-$NetBSD$
-
-Support tbb 2021.3 from
-https://github.com/AcademySoftwareFoundation/openvdb/commit/5b0ec82307c603adb147cee4bc1a925d407141f5
-
---- openvdb/openvdb/tools/PointPartitioner.h.orig 2021-06-11 21:38:41.000000000 +0000
-+++ openvdb/openvdb/tools/PointPartitioner.h
-@@ -23,7 +23,7 @@
-
- #include <tbb/blocked_range.h>
- #include <tbb/parallel_for.h>
--#include <tbb/task_scheduler_init.h>
-+#include <tbb/task_arena.h>
-
- #include <algorithm>
- #include <cmath> // for std::isfinite()
-@@ -764,7 +764,7 @@ inline void binAndSegment(
- using IndexPairListMap = std::map<Coord, IndexPairListPtr>;
- using IndexPairListMapPtr = std::shared_ptr<IndexPairListMap>;
-
-- size_t numTasks = 1, numThreads = size_t(tbb::task_scheduler_init::default_num_threads());
-+ size_t numTasks = 1, numThreads = size_t(tbb::this_task_arena::max_concurrency());
- if (points.size() > (numThreads * 2)) numTasks = numThreads * 2;
- else if (points.size() > numThreads) numTasks = numThreads;
-
diff --git a/openvdb/patches/patch-openvdb_openvdb_tools_PointsToMask.h b/openvdb/patches/patch-openvdb_openvdb_tools_PointsToMask.h
deleted file mode 100644
index 81e3b2a07d..0000000000
--- a/openvdb/patches/patch-openvdb_openvdb_tools_PointsToMask.h
+++ /dev/null
@@ -1,39 +0,0 @@
-$NetBSD$
-
-Support tbb 2021.3 from
-https://github.com/AcademySoftwareFoundation/openvdb/commit/5b0ec82307c603adb147cee4bc1a925d407141f5
-
---- openvdb/openvdb/tools/PointsToMask.h.orig 2021-06-11 21:38:41.000000000 +0000
-+++ openvdb/openvdb/tools/PointsToMask.h
-@@ -46,14 +46,18 @@
- #ifndef OPENVDB_TOOLS_POINTSTOMASK_HAS_BEEN_INCLUDED
- #define OPENVDB_TOOLS_POINTSTOMASK_HAS_BEEN_INCLUDED
-
-+
-+#include "openvdb/openvdb.h" // for MaskGrid
-+#include "openvdb/Grid.h"
-+#include "openvdb/Types.h"
-+#include "openvdb/util/NullInterrupter.h"
-+#include "openvdb/util/Threading.h"
-+
- #include <tbb/enumerable_thread_specific.h>
- #include <tbb/parallel_for.h>
- #include <tbb/parallel_reduce.h>
- #include <tbb/blocked_range.h>
--#include <openvdb/openvdb.h> // for MaskGrid
--#include <openvdb/Grid.h>
--#include <openvdb/Types.h>
--#include <openvdb/util/NullInterrupter.h>
-+
- #include <vector>
-
-
-@@ -150,7 +154,7 @@ private:
- bool interrupt() const
- {
- if (mInterrupter && util::wasInterrupted(mInterrupter)) {
-- tbb::task::self().cancel_group_execution();
-+ util::cancelGroupExecution();
- return true;
- }
- return false;
diff --git a/openvdb/patches/patch-openvdb_openvdb_tools_VolumeAdvect.h b/openvdb/patches/patch-openvdb_openvdb_tools_VolumeAdvect.h
deleted file mode 100644
index eef7939abe..0000000000
--- a/openvdb/patches/patch-openvdb_openvdb_tools_VolumeAdvect.h
+++ /dev/null
@@ -1,39 +0,0 @@
-$NetBSD$
-
-Support tbb 2021.3 from
-https://github.com/AcademySoftwareFoundation/openvdb/commit/5b0ec82307c603adb147cee4bc1a925d407141f5
-
---- openvdb/openvdb/tools/VolumeAdvect.h.orig 2021-06-11 21:38:41.000000000 +0000
-+++ openvdb/openvdb/tools/VolumeAdvect.h
-@@ -13,15 +13,18 @@
- #ifndef OPENVDB_TOOLS_VOLUME_ADVECT_HAS_BEEN_INCLUDED
- #define OPENVDB_TOOLS_VOLUME_ADVECT_HAS_BEEN_INCLUDED
-
--#include <tbb/parallel_for.h>
--#include <openvdb/Types.h>
--#include <openvdb/math/Math.h>
--#include <openvdb/util/NullInterrupter.h>
-+#include "openvdb/Types.h"
-+#include "openvdb/math/Math.h"
-+#include "openvdb/util/NullInterrupter.h"
-+#include "openvdb/util/Threading.h"
- #include "Interpolation.h"// for Sampler
- #include "VelocityFields.h" // for VelocityIntegrator
- #include "Morphology.h"//for dilateActiveValues
- #include "Prune.h"// for prune
- #include "Statistics.h" // for extrema
-+
-+#include <tbb/parallel_for.h>
-+
- #include <functional>
-
-
-@@ -294,7 +297,7 @@ private:
- bool interrupt() const
- {
- if (mInterrupter && util::wasInterrupted(mInterrupter)) {
-- tbb::task::self().cancel_group_execution();
-+ util::cancelGroupExecution();
- return true;
- }
- return false;
diff --git a/openvdb/patches/patch-openvdb_openvdb_tools_VolumeToMesh.h b/openvdb/patches/patch-openvdb_openvdb_tools_VolumeToMesh.h
deleted file mode 100644
index 465a74e2cd..0000000000
--- a/openvdb/patches/patch-openvdb_openvdb_tools_VolumeToMesh.h
+++ /dev/null
@@ -1,25 +0,0 @@
-$NetBSD$
-
-Support tbb 2021.3 from
-https://github.com/AcademySoftwareFoundation/openvdb/commit/5b0ec82307c603adb147cee4bc1a925d407141f5
-
---- openvdb/openvdb/tools/VolumeToMesh.h.orig 2021-06-11 21:38:41.000000000 +0000
-+++ openvdb/openvdb/tools/VolumeToMesh.h
-@@ -18,7 +18,7 @@
- #include <tbb/blocked_range.h>
- #include <tbb/parallel_for.h>
- #include <tbb/parallel_reduce.h>
--#include <tbb/task_scheduler_init.h>
-+#include <tbb/task_arena.h>
-
- #include <cmath> // for std::isfinite()
- #include <map>
-@@ -388,7 +388,7 @@ inline void
- fillArray(ValueType* array, const ValueType& val, const size_t length)
- {
- const auto grainSize = std::max<size_t>(
-- length / tbb::task_scheduler_init::default_num_threads(), 1024);
-+ length / tbb::this_task_arena::max_concurrency(), 1024);
- const tbb::blocked_range<size_t> range(0, length, grainSize);
- tbb::parallel_for(range, FillArray<ValueType>(array, val), tbb::simple_partitioner());
- }
diff --git a/openvdb/patches/patch-openvdb_openvdb_unittest_TestCoord.cc b/openvdb/patches/patch-openvdb_openvdb_unittest_TestCoord.cc
deleted file mode 100644
index 77b0ab9add..0000000000
--- a/openvdb/patches/patch-openvdb_openvdb_unittest_TestCoord.cc
+++ /dev/null
@@ -1,18 +0,0 @@
-$NetBSD$
-
-Support tbb 2021.3 from
-https://github.com/AcademySoftwareFoundation/openvdb/commit/5b0ec82307c603adb147cee4bc1a925d407141f5
-
---- openvdb/openvdb/unittest/TestCoord.cc.orig 2021-06-11 21:38:41.000000000 +0000
-+++ openvdb/openvdb/unittest/TestCoord.cc
-@@ -2,9 +2,9 @@
- // SPDX-License-Identifier: MPL-2.0
-
- #include <openvdb/Types.h>
-+#include <openvdb/math/Coord.h>
-
- #include <gtest/gtest.h>
--#include <tbb/tbb_stddef.h> // for tbb::split
-
- #include <unordered_map>
- #include <sstream>
diff --git a/openvdb/patches/patch-openvdb_openvdb_unittest_TestFile.cc b/openvdb/patches/patch-openvdb_openvdb_unittest_TestFile.cc
deleted file mode 100644
index b3d6587d5b..0000000000
--- a/openvdb/patches/patch-openvdb_openvdb_unittest_TestFile.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-$NetBSD$
-
-Support tbb 2021.3 from
-https://github.com/AcademySoftwareFoundation/openvdb/commit/5b0ec82307c603adb147cee4bc1a925d407141f5
-
---- openvdb/openvdb/unittest/TestFile.cc.orig 2021-06-11 21:38:41.000000000 +0000
-+++ openvdb/openvdb/unittest/TestFile.cc
-@@ -13,8 +13,11 @@
- #include <openvdb/version.h>
- #include <openvdb/openvdb.h>
- #include "util.h" // for unittest_util::makeSphere()
-+
- #include <gtest/gtest.h>
--#include <tbb/tbb_thread.h> // for tbb::this_tbb_thread::sleep()
-+
-+#include <thread>
-+#include <chrono>
- #include <algorithm> // for std::sort()
- #include <cstdio> // for remove() and rename()
- #include <fstream>
-@@ -2345,12 +2348,14 @@ TEST_F(TestFile, testAsync)
- helper.insert(id, filename);
- }
-
-- tbb::tick_count start = tbb::tick_count::now();
-+ auto start = std::chrono::steady_clock::now();
- while (!helper.ids.empty()) {
-- if ((tbb::tick_count::now() - start).seconds() > 60) break; // time out after 1 minute
-+ auto duration = std::chrono::duration_cast<std::chrono::seconds>(
-+ std::chrono::steady_clock::now() - start);
-+ if (size_t(duration.count()) > 60) break; // time out after 1 minute
-
- // Wait one second for tasks to complete.
-- tbb::this_tbb_thread::sleep(tbb::tick_count::interval_t(1.0/*sec*/));
-+ std::this_thread::sleep_for(std::chrono::seconds(1));
-
- // Poll each task in the pending map.
- std::set<io::Queue::Id> ids = helper.ids; // iterate over a copy
-@@ -2380,7 +2385,7 @@ TEST_F(TestFile, testAsync)
- helper.insert(id, filename);
- }
- while (!queue.empty()) {
-- tbb::this_tbb_thread::sleep(tbb::tick_count::interval_t(1.0/*sec*/));
-+ std::this_thread::sleep_for(std::chrono::seconds(1));
- }
- }
- {
-@@ -2405,7 +2410,7 @@ TEST_F(TestFile, testAsync)
- EXPECT_THROW(queue.write(grids, io::Stream(file2)), openvdb::RuntimeError);
-
- while (!queue.empty()) {
-- tbb::this_tbb_thread::sleep(tbb::tick_count::interval_t(1.0/*sec*/));
-+ std::this_thread::sleep_for(std::chrono::seconds(1));
- }
- }
- }
diff --git a/openvdb/patches/patch-openvdb_openvdb_unittest_TestUtil.cc b/openvdb/patches/patch-openvdb_openvdb_unittest_TestUtil.cc
deleted file mode 100644
index 493f195800..0000000000
--- a/openvdb/patches/patch-openvdb_openvdb_unittest_TestUtil.cc
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD$
-
-Support tbb 2021.3 from
-https://github.com/AcademySoftwareFoundation/openvdb/commit/5b0ec82307c603adb147cee4bc1a925d407141f5
-
---- openvdb/openvdb/unittest/TestUtil.cc.orig 2021-06-11 21:38:41.000000000 +0000
-+++ openvdb/openvdb/unittest/TestUtil.cc
-@@ -8,7 +8,6 @@
-
- #include <gtest/gtest.h>
-
--#include <tbb/task_scheduler_init.h>
- #include <tbb/enumerable_thread_specific.h>
- #include <tbb/parallel_for.h>
- #include <tbb/blocked_range.h>
diff --git a/openvdb/patches/patch-openvdb_openvdb_unittest_TestValueAccessor.cc b/openvdb/patches/patch-openvdb_openvdb_unittest_TestValueAccessor.cc
deleted file mode 100644
index dcb1cc16c6..0000000000
--- a/openvdb/patches/patch-openvdb_openvdb_unittest_TestValueAccessor.cc
+++ /dev/null
@@ -1,78 +0,0 @@
-$NetBSD$
-
-Support tbb 2021.3 from
-https://github.com/AcademySoftwareFoundation/openvdb/commit/5b0ec82307c603adb147cee4bc1a925d407141f5
-
---- openvdb/openvdb/unittest/TestValueAccessor.cc.orig 2021-06-11 21:38:41.000000000 +0000
-+++ openvdb/openvdb/unittest/TestValueAccessor.cc
-@@ -378,22 +378,21 @@ TEST_F(TestValueAccessor, testMultithrea
- //using AccessorT = openvdb::tree::ValueAccessor<Tree4Type>;
-
- // Task to perform multiple reads through a shared accessor
-- struct ReadTask: public tbb::task {
-+ struct ReadTask {
- AccessorT& acc;
- ReadTask(AccessorT& c): acc(c) {}
-- tbb::task* execute()
-+ void execute()
- {
- for (int i = -MAX_COORD; i < MAX_COORD; ++i) {
- ASSERT_DOUBLES_EXACTLY_EQUAL(double(i), acc.getValue(openvdb::Coord(i)));
- }
-- return nullptr;
- }
- };
- // Task to perform multiple writes through a shared accessor
-- struct WriteTask: public tbb::task {
-+ struct WriteTask {
- AccessorT& acc;
- WriteTask(AccessorT& c): acc(c) {}
-- tbb::task* execute()
-+ void execute()
- {
- for (int i = -MAX_COORD; i < MAX_COORD; ++i) {
- float f = acc.getValue(openvdb::Coord(i));
-@@ -401,26 +400,20 @@ TEST_F(TestValueAccessor, testMultithrea
- acc.setValue(openvdb::Coord(i), float(i));
- ASSERT_DOUBLES_EXACTLY_EQUAL(float(i), acc.getValue(openvdb::Coord(i)));
- }
-- return nullptr;
- }
- };
- // Parent task to spawn multiple parallel read and write tasks
-- struct RootTask: public tbb::task {
-+ struct RootTask {
- AccessorT& acc;
- RootTask(AccessorT& c): acc(c) {}
-- tbb::task* execute()
-+ void execute()
- {
-- ReadTask* r[3]; WriteTask* w[3];
-+ tbb::task_group tasks;
- for (int i = 0; i < 3; ++i) {
-- r[i] = new(allocate_child()) ReadTask(acc);
-- w[i] = new(allocate_child()) WriteTask(acc);
-+ tasks.run([&] { ReadTask r(acc); r.execute(); });
-+ tasks.run([&] { WriteTask w(acc); w.execute(); });
- }
-- set_ref_count(6 /*children*/ + 1 /*wait*/);
-- for (int i = 0; i < 3; ++i) {
-- spawn(*r[i]); spawn(*w[i]);
-- }
-- wait_for_all();
-- return nullptr;
-+ tasks.wait();
- }
- };
-
-@@ -432,8 +425,8 @@ TEST_F(TestValueAccessor, testMultithrea
- }
-
- // Run multiple read and write tasks in parallel.
-- RootTask& root = *new(tbb::task::allocate_root()) RootTask(acc);
-- tbb::task::spawn_root_and_wait(root);
-+ RootTask root(acc);
-+ root.execute();
-
- #undef MAX_COORD
- }
diff --git a/openvdb/patches/patch-openvdb_openvdb_util_Threading.h b/openvdb/patches/patch-openvdb_openvdb_util_Threading.h
deleted file mode 100644
index 26a8b23b7b..0000000000
--- a/openvdb/patches/patch-openvdb_openvdb_util_Threading.h
+++ /dev/null
@@ -1,58 +0,0 @@
-$NetBSD$
-
-Support tbb 2021.3 from
-https://github.com/AcademySoftwareFoundation/openvdb/commit/5b0ec82307c603adb147cee4bc1a925d407141f5
-
---- openvdb/openvdb/util/Threading.h.orig 2021-08-11 09:50:26.288237592 +0000
-+++ openvdb/openvdb/util/Threading.h
-@@ -0,0 +1,50 @@
-+// Copyright Contributors to the OpenVDB Project
-+// SPDX-License-Identifier: MPL-2.0
-+//
-+/// @file Threading.h
-+
-+#ifndef OPENVDB_UTIL_THREADING_HAS_BEEN_INCLUDED
-+#define OPENVDB_UTIL_THREADING_HAS_BEEN_INCLUDED
-+
-+#include "openvdb/version.h"
-+
-+/// @note tbb/blocked_range.h is the ONLY include that persists from TBB 2020
-+/// to TBB 2021 that itself includes the TBB specific version header files.
-+/// In TBB 2020, the version header was called tbb/stddef.h. In 2021, it's
-+/// called tbb/version.h. We include tbb/blocked_range.h here to indirectly
-+/// access the version defines in a consistent way so that downstream
-+/// software doesn't need to provide compile time defines.
-+#include <tbb/blocked_range.h>
-+#include <tbb/task.h>
-+#include <tbb/task_group.h>
-+
-+namespace openvdb {
-+OPENVDB_USE_VERSION_NAMESPACE
-+namespace OPENVDB_VERSION_NAME {
-+namespace util {
-+
-+inline bool cancelGroupExecution()
-+{
-+#if TBB_INTERFACE_VERSION_MAJOR >= 12
-+ auto ctx = tbb::task::current_context();
-+ return ctx ? ctx->cancel_group_execution() : false;
-+#else
-+ return tbb::task::self().cancel_group_execution();
-+#endif
-+}
-+
-+inline bool isGroupExecutionCancelled()
-+{
-+#if TBB_INTERFACE_VERSION_MAJOR >= 12
-+ auto ctx = tbb::task::current_context();
-+ return ctx ? ctx->is_group_execution_cancelled() : false;
-+#else
-+ return tbb::task::self().is_cancelled();
-+#endif
-+}
-+
-+} // namespace util
-+} // namespace OPENVDB_VERSION_NAME
-+} // namespace openvdb
-+
-+#endif // OPENVDB_UTIL_THREADING_HAS_BEEN_INCLUDED
Home |
Main Index |
Thread Index |
Old Index