mirror of
https://github.com/PixarAnimationStudios/OpenSubdiv
synced 2024-09-18 22:00:05 +00:00
Merge pull request #1317 from davidgyu/dev_tbb_task_scheduler_init_deprecation
Marked deprecated Osd::*Evaluator::SetNumThreads()
This commit is contained in:
commit
06ad0bbf5c
@ -361,6 +361,8 @@ OmpEvaluator::Synchronize(void * /*deviceContext*/) {
|
||||
/* static */
|
||||
void
|
||||
OmpEvaluator::SetNumThreads(int numThreads) {
|
||||
// This is deprecated functionality. We preserve the existing behavior
|
||||
// for consistency.
|
||||
omp_set_num_threads(numThreads);
|
||||
}
|
||||
|
||||
|
@ -1225,6 +1225,7 @@ public:
|
||||
|
||||
static void Synchronize(void *deviceContext = NULL);
|
||||
|
||||
/// \brief Deprecated. Client code should initialize OpenMP.
|
||||
static void SetNumThreads(int numThreads);
|
||||
};
|
||||
|
||||
|
@ -25,7 +25,12 @@
|
||||
#include "../osd/tbbEvaluator.h"
|
||||
#include "../osd/tbbKernel.h"
|
||||
|
||||
// Get TBB version from tbb/parallel_for used by osd/tbbKernel
|
||||
#include <tbb/parallel_for.h>
|
||||
#if defined(TBB_INTERFACE_VERSION_MAJOR) && (TBB_INTERFACE_VERSION_MAJOR < 12)
|
||||
// This is deprecated functionality.
|
||||
#include <tbb/task_scheduler_init.h>
|
||||
#endif
|
||||
|
||||
namespace OpenSubdiv {
|
||||
namespace OPENSUBDIV_VERSION {
|
||||
@ -215,11 +220,15 @@ TbbEvaluator::Synchronize(void *) {
|
||||
/* static */
|
||||
void
|
||||
TbbEvaluator::SetNumThreads(int numThreads) {
|
||||
#if defined(TBB_INTERFACE_VERSION_MAJOR) && (TBB_INTERFACE_VERSION_MAJOR < 12)
|
||||
// This is deprecated functionality. We preserve the existing behavior
|
||||
// for consistency (when using older versions of tbb).
|
||||
if (numThreads == -1) {
|
||||
tbb::task_scheduler_init init;
|
||||
} else {
|
||||
tbb::task_scheduler_init init(numThreads);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
} // end namespace Osd
|
||||
|
@ -1226,8 +1226,7 @@ public:
|
||||
/// \brief synchronize all asynchronous computation invoked on this device.
|
||||
static void Synchronize(void *deviceContext = NULL);
|
||||
|
||||
/// \brief initialize tbb task schedular
|
||||
/// (optional: client may use tbb::task_scheduler_init)
|
||||
/// \brief Deprecated. Client code should initialize TBB.
|
||||
///
|
||||
/// @param numThreads how many threads
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user