Implement tbb runtime device configuration and update vtkm to use it
This commit is contained in:
parent
b168c2003b
commit
9baa7cd9fa
@ -21,13 +21,6 @@
|
|||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
#ifdef VTKM_ENABLE_TBB
|
|
||||||
#include <tbb/tbb.h>
|
|
||||||
#endif // TBB
|
|
||||||
|
|
||||||
// For the TBB implementation, the number of threads can be customized using a
|
|
||||||
// "NumThreads [numThreads]" argument.
|
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -111,41 +104,6 @@ int main(int argc, char* argv[])
|
|||||||
vtkm::cont::GetRuntimeDeviceTracker().ForceDevice(Config.Device);
|
vtkm::cont::GetRuntimeDeviceTracker().ForceDevice(Config.Device);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle NumThreads command-line arg:
|
|
||||||
// TODO: Use the VTK-m library to set the number of threads (when that becomes available).
|
|
||||||
#ifdef VTKM_ENABLE_TBB
|
|
||||||
#if TBB_VERSION_MAJOR >= 2020
|
|
||||||
int numThreads = tbb::task_arena{}.max_concurrency();
|
|
||||||
#else
|
|
||||||
int numThreads = tbb::task_scheduler_init::automatic;
|
|
||||||
#endif
|
|
||||||
#endif // TBB
|
|
||||||
|
|
||||||
if (argc == 3)
|
|
||||||
{
|
|
||||||
if (std::string(argv[1]) == "NumThreads")
|
|
||||||
{
|
|
||||||
#ifdef VTKM_ENABLE_TBB
|
|
||||||
std::istringstream parse(argv[2]);
|
|
||||||
parse >> numThreads;
|
|
||||||
std::cout << "Selected " << numThreads << " TBB threads." << std::endl;
|
|
||||||
#else
|
|
||||||
std::cerr << "NumThreads valid only on TBB. Ignoring." << std::endl;
|
|
||||||
#endif // TBB
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: Use the VTK-m library to set the number of threads (when that becomes available).
|
|
||||||
#ifdef VTKM_ENABLE_TBB
|
|
||||||
#if TBB_VERSION_MAJOR >= 2020
|
|
||||||
// Must not be destroyed as long as benchmarks are running:
|
|
||||||
tbb::global_control tbbControl(tbb::global_control::max_allowed_parallelism, numThreads);
|
|
||||||
#else
|
|
||||||
// Must not be destroyed as long as benchmarks are running:
|
|
||||||
tbb::task_scheduler_init init(numThreads);
|
|
||||||
#endif
|
|
||||||
#endif // TBB
|
|
||||||
|
|
||||||
// handle benchmarking related args and run benchmarks:
|
// handle benchmarking related args and run benchmarks:
|
||||||
VTKM_EXECUTE_BENCHMARKS(argc, args.data());
|
VTKM_EXECUTE_BENCHMARKS(argc, args.data());
|
||||||
}
|
}
|
||||||
|
@ -33,9 +33,6 @@
|
|||||||
|
|
||||||
#include <vtkm/internal/Windows.h>
|
#include <vtkm/internal/Windows.h>
|
||||||
|
|
||||||
#ifdef VTKM_ENABLE_TBB
|
|
||||||
#include <tbb/tbb.h>
|
|
||||||
#endif
|
|
||||||
#ifdef VTKM_ENABLE_OPENMP
|
#ifdef VTKM_ENABLE_OPENMP
|
||||||
#include <omp.h>
|
#include <omp.h>
|
||||||
#endif
|
#endif
|
||||||
@ -1242,41 +1239,6 @@ int main(int argc, char* argv[])
|
|||||||
vtkm::cont::GetRuntimeDeviceTracker().ForceDevice(Config.Device);
|
vtkm::cont::GetRuntimeDeviceTracker().ForceDevice(Config.Device);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle NumThreads command-line arg:
|
|
||||||
// TODO: Use the VTK-m library to set the number of threads (when that becomes available).
|
|
||||||
#ifdef VTKM_ENABLE_TBB
|
|
||||||
#if TBB_VERSION_MAJOR >= 2020
|
|
||||||
int numThreads = tbb::task_arena{}.max_concurrency();
|
|
||||||
#else
|
|
||||||
int numThreads = tbb::task_scheduler_init::automatic;
|
|
||||||
#endif
|
|
||||||
#endif // TBB
|
|
||||||
|
|
||||||
if (argc == 3)
|
|
||||||
{
|
|
||||||
if (std::string(argv[1]) == "NumThreads")
|
|
||||||
{
|
|
||||||
#ifdef VTKM_ENABLE_TBB
|
|
||||||
std::istringstream parse(argv[2]);
|
|
||||||
parse >> numThreads;
|
|
||||||
std::cout << "Selected " << numThreads << " TBB threads." << std::endl;
|
|
||||||
#else
|
|
||||||
std::cerr << "NumThreads valid only on TBB. Ignoring." << std::endl;
|
|
||||||
#endif // TBB
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: Use the VTK-m library to set the number of threads (when that becomes available).
|
|
||||||
#ifdef VTKM_ENABLE_TBB
|
|
||||||
#if TBB_VERSION_MAJOR >= 2020
|
|
||||||
// Must not be destroyed as long as benchmarks are running:
|
|
||||||
tbb::global_control tbbControl(tbb::global_control::max_allowed_parallelism, numThreads);
|
|
||||||
#else
|
|
||||||
// Must not be destroyed as long as benchmarks are running:
|
|
||||||
tbb::task_scheduler_init init(numThreads);
|
|
||||||
#endif
|
|
||||||
#endif // TBB
|
|
||||||
|
|
||||||
// handle benchmarking related args and run benchmarks:
|
// handle benchmarking related args and run benchmarks:
|
||||||
VTKM_EXECUTE_BENCHMARKS(argc, args.data());
|
VTKM_EXECUTE_BENCHMARKS(argc, args.data());
|
||||||
}
|
}
|
||||||
|
@ -80,9 +80,6 @@
|
|||||||
// If the fields are not specified, the first field with the correct association
|
// If the fields are not specified, the first field with the correct association
|
||||||
// is used. If no such field exists, one will be generated from the data.
|
// is used. If no such field exists, one will be generated from the data.
|
||||||
|
|
||||||
// For the TBB/OpenMP implementations, the number of threads can be customized
|
|
||||||
// using a "NumThreads [numThreads]" argument.
|
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -791,7 +788,6 @@ enum optionIndex
|
|||||||
{
|
{
|
||||||
UNKNOWN,
|
UNKNOWN,
|
||||||
HELP,
|
HELP,
|
||||||
NUM_THREADS,
|
|
||||||
FILENAME,
|
FILENAME,
|
||||||
POINT_SCALARS,
|
POINT_SCALARS,
|
||||||
CELL_SCALARS,
|
CELL_SCALARS,
|
||||||
@ -802,7 +798,6 @@ enum optionIndex
|
|||||||
|
|
||||||
void InitDataSet(int& argc, char** argv)
|
void InitDataSet(int& argc, char** argv)
|
||||||
{
|
{
|
||||||
int numThreads = 0;
|
|
||||||
std::string filename;
|
std::string filename;
|
||||||
vtkm::Id waveletDim = 256;
|
vtkm::Id waveletDim = 256;
|
||||||
bool tetra = false;
|
bool tetra = false;
|
||||||
@ -817,12 +812,6 @@ void InitDataSet(int& argc, char** argv)
|
|||||||
usage.push_back({ UNKNOWN, 0, "", "", Arg::None, "Input data options are:" });
|
usage.push_back({ UNKNOWN, 0, "", "", Arg::None, "Input data options are:" });
|
||||||
usage.push_back({ HELP, 0, "h", "help", Arg::None, " -h, --help\tDisplay this help." });
|
usage.push_back({ HELP, 0, "h", "help", Arg::None, " -h, --help\tDisplay this help." });
|
||||||
usage.push_back({ UNKNOWN, 0, "", "", Arg::None, Config.Usage.c_str() });
|
usage.push_back({ UNKNOWN, 0, "", "", Arg::None, Config.Usage.c_str() });
|
||||||
usage.push_back({ NUM_THREADS,
|
|
||||||
0,
|
|
||||||
"",
|
|
||||||
"num-threads",
|
|
||||||
Arg::Number,
|
|
||||||
" --num-threads <N> \tSpecify the number of threads to use." });
|
|
||||||
usage.push_back({ FILENAME,
|
usage.push_back({ FILENAME,
|
||||||
0,
|
0,
|
||||||
"",
|
"",
|
||||||
@ -880,22 +869,6 @@ void InitDataSet(int& argc, char** argv)
|
|||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options[NUM_THREADS])
|
|
||||||
{
|
|
||||||
std::istringstream parse(options[NUM_THREADS].arg);
|
|
||||||
parse >> numThreads;
|
|
||||||
if (Config.Device == vtkm::cont::DeviceAdapterTagTBB() ||
|
|
||||||
Config.Device == vtkm::cont::DeviceAdapterTagOpenMP())
|
|
||||||
{
|
|
||||||
std::cout << "Selected " << numThreads << " " << Config.Device.GetName() << " threads."
|
|
||||||
<< std::endl;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
std::cerr << options[NUM_THREADS].name << " not valid on this device. Ignoring." << std::endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options[FILENAME])
|
if (options[FILENAME])
|
||||||
{
|
{
|
||||||
filename = options[FILENAME].arg;
|
filename = options[FILENAME].arg;
|
||||||
@ -922,23 +895,6 @@ void InitDataSet(int& argc, char** argv)
|
|||||||
|
|
||||||
tetra = (options[TETRA] != nullptr);
|
tetra = (options[TETRA] != nullptr);
|
||||||
|
|
||||||
// TODO: Use the VTK-m library to set the number of threads (when that becomes available).
|
|
||||||
#ifdef VTKM_ENABLE_TBB
|
|
||||||
#if TBB_VERSION_MAJOR >= 2020
|
|
||||||
if (numThreads < 1)
|
|
||||||
{
|
|
||||||
// Ask TBB how many threads are available.
|
|
||||||
numThreads = tbb::task_arena{}.max_concurrency();
|
|
||||||
}
|
|
||||||
// Must not be destroyed as long as benchmarks are running:
|
|
||||||
tbb::global_control tbbControl(tbb::global_control::max_allowed_parallelism, numThreads);
|
|
||||||
#else // TBB_VERSION_MAJOR < 2020
|
|
||||||
// Must not be destroyed as long as benchmarks are running:
|
|
||||||
tbb::task_scheduler_init init((numThreads > 0) ? numThreads
|
|
||||||
: tbb::task_scheduler_init::automatic);
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Now go back through the arg list and remove anything that is not in the list of
|
// Now go back through the arg list and remove anything that is not in the list of
|
||||||
// unknown options or non-option arguments.
|
// unknown options or non-option arguments.
|
||||||
int destArg = 1;
|
int destArg = 1;
|
||||||
|
@ -77,10 +77,6 @@
|
|||||||
#include <vtkm/worklet/contourtree_augmented/Types.h>
|
#include <vtkm/worklet/contourtree_augmented/Types.h>
|
||||||
#include <vtkm/worklet/contourtree_augmented/processcontourtree/Branch.h>
|
#include <vtkm/worklet/contourtree_augmented/processcontourtree/Branch.h>
|
||||||
|
|
||||||
#ifdef ENABLE_SET_NUM_THREADS
|
|
||||||
#include "tbb/task_scheduler_init.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
VTKM_THIRDPARTY_PRE_INCLUDE
|
VTKM_THIRDPARTY_PRE_INCLUDE
|
||||||
#include <vtkm/thirdparty/diy/Configure.h>
|
#include <vtkm/thirdparty/diy/Configure.h>
|
||||||
@ -227,29 +223,6 @@ int main(int argc, char* argv[])
|
|||||||
computeBranchDecomposition = false;
|
computeBranchDecomposition = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef ENABLE_SET_NUM_THREADS
|
|
||||||
int numThreads = tbb::task_scheduler_init::default_num_threads();
|
|
||||||
if (parser.hasOption("--numThreads"))
|
|
||||||
{
|
|
||||||
bool deviceIsTBB = (device.GetName() == "TBB");
|
|
||||||
// Set the number of threads to be used for TBB
|
|
||||||
if (deviceIsTBB)
|
|
||||||
{
|
|
||||||
numThreads = std::stoi(parser.getOption("--numThreads"));
|
|
||||||
tbb::task_scheduler_init schedulerInit(numThreads);
|
|
||||||
}
|
|
||||||
// Print warning about mismatch between the --numThreads and -d/--device option
|
|
||||||
else
|
|
||||||
{
|
|
||||||
VTKM_LOG_S(vtkm::cont::LogLevel::Warn,
|
|
||||||
"WARNING: Mismatch between --numThreads and -d/--device option."
|
|
||||||
"numThreads option requires the use of TBB as device. "
|
|
||||||
"Ignoring the numThread option.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Iso value selection parameters
|
// Iso value selection parameters
|
||||||
// Approach to be used to select contours based on the tree
|
// Approach to be used to select contours based on the tree
|
||||||
vtkm::Id contourType = 0;
|
vtkm::Id contourType = 0;
|
||||||
@ -316,10 +289,6 @@ int main(int argc, char* argv[])
|
|||||||
"Requires --augmentTree (Default=True)"
|
"Requires --augmentTree (Default=True)"
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
std::cout << "--printCT Print the contour tree. (Default=False)" << std::endl;
|
std::cout << "--printCT Print the contour tree. (Default=False)" << std::endl;
|
||||||
#ifdef ENABLE_SET_NUM_THREADS
|
|
||||||
std::cout << "--numThreads Specifiy the number of threads to use. Available only with TBB."
|
|
||||||
<< std::endl;
|
|
||||||
#endif
|
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
std::cout << "---------------------- Isovalue Selection Options ----------------------"
|
std::cout << "---------------------- Isovalue Selection Options ----------------------"
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
@ -360,10 +329,6 @@ int main(int argc, char* argv[])
|
|||||||
#ifdef WITH_MPI
|
#ifdef WITH_MPI
|
||||||
" nblocks=" << numBlocks << std::endl
|
" nblocks=" << numBlocks << std::endl
|
||||||
<<
|
<<
|
||||||
#endif
|
|
||||||
#ifdef ENABLE_SET_NUM_THREADS
|
|
||||||
" numThreads=" << numThreads << std::endl
|
|
||||||
<<
|
|
||||||
#endif
|
#endif
|
||||||
" computeIsovalues=" << (numLevels > 0);
|
" computeIsovalues=" << (numLevels > 0);
|
||||||
VTKM_LOG_S(vtkm::cont::LogLevel::Info, std::endl << logmessage.str());
|
VTKM_LOG_S(vtkm::cont::LogLevel::Info, std::endl << logmessage.str());
|
||||||
|
@ -77,10 +77,6 @@
|
|||||||
#include <vtkm/worklet/contourtree_augmented/Types.h>
|
#include <vtkm/worklet/contourtree_augmented/Types.h>
|
||||||
#include <vtkm/worklet/contourtree_distributed/TreeCompiler.h>
|
#include <vtkm/worklet/contourtree_distributed/TreeCompiler.h>
|
||||||
|
|
||||||
#ifdef ENABLE_SET_NUM_THREADS
|
|
||||||
#include "tbb/task_scheduler_init.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
VTKM_THIRDPARTY_PRE_INCLUDE
|
VTKM_THIRDPARTY_PRE_INCLUDE
|
||||||
#include <vtkm/thirdparty/diy/Configure.h>
|
#include <vtkm/thirdparty/diy/Configure.h>
|
||||||
@ -237,28 +233,6 @@ int main(int argc, char* argv[])
|
|||||||
forwardSummary = true;
|
forwardSummary = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ENABLE_SET_NUM_THREADS
|
|
||||||
int numThreads = tbb::task_scheduler_init::default_num_threads();
|
|
||||||
if (parser.hasOption("--numThreads"))
|
|
||||||
{
|
|
||||||
bool deviceIsTBB = (device.GetName() == "TBB");
|
|
||||||
// Set the number of threads to be used for TBB
|
|
||||||
if (deviceIsTBB)
|
|
||||||
{
|
|
||||||
numThreads = std::stoi(parser.getOption("--numThreads"));
|
|
||||||
tbb::task_scheduler_init schedulerInit(numThreads);
|
|
||||||
}
|
|
||||||
// Print warning about mismatch between the --numThreads and -d/--device option
|
|
||||||
else
|
|
||||||
{
|
|
||||||
VTKM_LOG_S(vtkm::cont::LogLevel::Warn,
|
|
||||||
"WARNING: Mismatch between --numThreads and -d/--device option."
|
|
||||||
"numThreads option requires the use of TBB as device. "
|
|
||||||
"Ignoring the numThread option.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int numBlocks = size;
|
int numBlocks = size;
|
||||||
int blocksPerRank = 1;
|
int blocksPerRank = 1;
|
||||||
if (parser.hasOption("--numBlocks"))
|
if (parser.hasOption("--numBlocks"))
|
||||||
@ -305,10 +279,6 @@ int main(int argc, char* argv[])
|
|||||||
<< "computation (Default=False). " << std::endl;
|
<< "computation (Default=False). " << std::endl;
|
||||||
std::cout << "--saveTreeCompilerData Save data files needed for the tree compiler"
|
std::cout << "--saveTreeCompilerData Save data files needed for the tree compiler"
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
#ifdef ENABLE_SET_NUM_THREADS
|
|
||||||
std::cout << "--numThreads Specifiy the number of threads to use. "
|
|
||||||
<< "Available only with TBB." << std::endl;
|
|
||||||
#endif
|
|
||||||
std::cout << "--numBlocks Number of blocks to use during computation "
|
std::cout << "--numBlocks Number of blocks to use during computation "
|
||||||
<< "(Default=number of MPI ranks.)" << std::endl;
|
<< "(Default=number of MPI ranks.)" << std::endl;
|
||||||
std::cout << "--forwardSummary Forward the summary timings also to the per-rank "
|
std::cout << "--forwardSummary Forward the summary timings also to the per-rank "
|
||||||
@ -332,9 +302,6 @@ int main(int argc, char* argv[])
|
|||||||
<< " saveDot=" << saveDotFiles << std::endl
|
<< " saveDot=" << saveDotFiles << std::endl
|
||||||
<< " saveTreeCompilerData=" << saveTreeCompilerData << std::endl
|
<< " saveTreeCompilerData=" << saveTreeCompilerData << std::endl
|
||||||
<< " forwardSummary=" << forwardSummary << std::endl
|
<< " forwardSummary=" << forwardSummary << std::endl
|
||||||
#ifdef ENABLE_SET_NUM_THREADS
|
|
||||||
<< " numThreads=" << numThreads << std::endl
|
|
||||||
#endif
|
|
||||||
<< " nblocks=" << numBlocks << std::endl);
|
<< " nblocks=" << numBlocks << std::endl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,6 +13,12 @@
|
|||||||
#include <vtkm/cont/internal/RuntimeDeviceConfiguration.h>
|
#include <vtkm/cont/internal/RuntimeDeviceConfiguration.h>
|
||||||
#include <vtkm/cont/tbb/internal/DeviceAdapterTagTBB.h>
|
#include <vtkm/cont/tbb/internal/DeviceAdapterTagTBB.h>
|
||||||
|
|
||||||
|
VTKM_THIRDPARTY_PRE_INCLUDE
|
||||||
|
#include <tbb/tbb.h>
|
||||||
|
VTKM_THIRDPARTY_POST_INCLUDE
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
namespace vtkm
|
namespace vtkm
|
||||||
{
|
{
|
||||||
namespace cont
|
namespace cont
|
||||||
@ -24,27 +30,59 @@ template <>
|
|||||||
class RuntimeDeviceConfiguration<vtkm::cont::DeviceAdapterTagTBB>
|
class RuntimeDeviceConfiguration<vtkm::cont::DeviceAdapterTagTBB>
|
||||||
: public vtkm::cont::internal::RuntimeDeviceConfigurationBase
|
: public vtkm::cont::internal::RuntimeDeviceConfigurationBase
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
VTKM_CONT
|
||||||
|
RuntimeDeviceConfiguration<vtkm::cont::DeviceAdapterTagTBB>()
|
||||||
|
:
|
||||||
|
#if TBB_VERSION_MAJOR >= 2020
|
||||||
|
HardwareMaxThreads(::tbb::task_arena{}.max_concurrency())
|
||||||
|
#else
|
||||||
|
HardwareMaxThreads(::tbb::task_scheduler_init::default_num_threads())
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
VTKM_CONT vtkm::cont::DeviceAdapterId GetDevice() const override final
|
VTKM_CONT vtkm::cont::DeviceAdapterId GetDevice() const override final
|
||||||
{
|
{
|
||||||
return vtkm::cont::DeviceAdapterTagTBB{};
|
return vtkm::cont::DeviceAdapterTagTBB{};
|
||||||
}
|
}
|
||||||
|
|
||||||
VTKM_CONT virtual RuntimeDeviceConfigReturnCode SetThreads(const vtkm::Id&) override final
|
VTKM_CONT virtual RuntimeDeviceConfigReturnCode SetThreads(const vtkm::Id& value) override final
|
||||||
{
|
{
|
||||||
// TODO: vtk-m set the number of global threads
|
#if TBB_VERSION_MAJOR >= 2020
|
||||||
|
GlobalControl.reset(new ::tbb::global_control(::tbb::global_control::max_allowed_parallelism,
|
||||||
|
value > 0 ? value : this->HardwareMaxThreads));
|
||||||
|
#else
|
||||||
|
TaskSchedulerInit.reset(new ::tbb::task_scheduler_init(
|
||||||
|
value > 0 ? static_cast<int>(value) : static_cast<int>(this->HardwareMaxThreads)));
|
||||||
|
#endif
|
||||||
return RuntimeDeviceConfigReturnCode::SUCCESS;
|
return RuntimeDeviceConfigReturnCode::SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
VTKM_CONT virtual RuntimeDeviceConfigReturnCode GetThreads(vtkm::Id&) const override final
|
VTKM_CONT virtual RuntimeDeviceConfigReturnCode GetThreads(vtkm::Id& value) const override final
|
||||||
{
|
{
|
||||||
// TODO: Get number of TBB threads here (essentially just threads supported by architecture)
|
#if TBB_VERSION_MAJOR >= 2020
|
||||||
|
value = ::tbb::global_control::active_value(::tbb::global_control::max_allowed_parallelism);
|
||||||
|
#else
|
||||||
|
value = ::tbb::task_scheduler_init::default_num_threads();
|
||||||
|
#endif
|
||||||
return RuntimeDeviceConfigReturnCode::SUCCESS;
|
return RuntimeDeviceConfigReturnCode::SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
VTKM_CONT virtual RuntimeDeviceConfigReturnCode GetMaxThreads(vtkm::Id&) const override final
|
VTKM_CONT virtual RuntimeDeviceConfigReturnCode GetMaxThreads(
|
||||||
|
vtkm::Id& value) const override final
|
||||||
{
|
{
|
||||||
|
value = this->HardwareMaxThreads;
|
||||||
return RuntimeDeviceConfigReturnCode::SUCCESS;
|
return RuntimeDeviceConfigReturnCode::SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
#if TBB_VERSION_MAJOR >= 2020
|
||||||
|
std::unique_ptr<::tbb::global_control> GlobalControl;
|
||||||
|
#else
|
||||||
|
std::unique_ptr<::tbb::task_scheduler_init> TaskSchedulerInit;
|
||||||
|
#endif
|
||||||
|
vtkm::Id HardwareMaxThreads;
|
||||||
};
|
};
|
||||||
} // namespace vktm::cont::internal
|
} // namespace vktm::cont::internal
|
||||||
} // namespace vtkm::cont
|
} // namespace vtkm::cont
|
||||||
|
Loading…
Reference in New Issue
Block a user