Skip to content
Snippets Groups Projects
Commit 0ea4470f authored by Dave Pugmire's avatar Dave Pugmire
Browse files

Simplify the code a little.

parent 17964310
No related branches found
No related tags found
2 merge requests!2615Draft: DONTMERGE ME: TEST FOR 1.7.0-rc1 is our 9th official release of VTK-m.,!2548Add threaded filters for multiblock dataset.
......@@ -353,25 +353,22 @@ inline VTKM_CONT vtkm::Id Filter<Derived>::DetermineNumberOfThreads(
vtkm::Id availThreads = 1;
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
const bool runOnSerial = tracker.CanRunOn(vtkm::cont::DeviceAdapterTagSerial{});
const bool runOnCuda = tracker.CanRunOn(vtkm::cont::DeviceAdapterTagCuda{});
const bool runOnKokkos = tracker.CanRunOn(vtkm::cont::DeviceAdapterTagKokkos{});
const bool runOnOpenMP = tracker.CanRunOn(vtkm::cont::DeviceAdapterTagOpenMP{});
if (runOnSerial)
availThreads = 1;
else if (runOnCuda)
if (tracker.CanRunOn(vtkm::cont::DeviceAdapterTagCuda{}))
availThreads = threadsPerGPU;
else if (runOnOpenMP)
availThreads = threadsPerCPU;
else if (runOnKokkos)
else if (tracker.CanRunOn(vtkm::cont::DeviceAdapterTagKokkos{}))
{
//Kokkos doesn't support threading on the CPU.
#ifdef VTKM_KOKKOS_CUDA
availThreads = threadsPerGPU;
#else
availThreads = 1;
#endif
}
else if (tracker.CanRunOn(vtkm::cont::DeviceAdapterTagSerial{}))
availThreads = 1;
else
availThreads = threadsPerCPU;
vtkm::Id numThreads = std::min<vtkm::Id>(numDS, availThreads);
return numThreads;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment