Commit 2c026508 authored by Robert Maynard's avatar Robert Maynard Committed by Kitware Robot

Merge topic 'correct_openmp_timeouts'

9c292007 UnitTestBoundingIntervalHierarchy handles systems under load better
671c1df5 Timer logs the proper device name when called with an invalid device
d3d66a33 GameOfLife example always uses the proper device adapter
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !1645
parents 39cf9dac 9c292007
......@@ -204,7 +204,7 @@ struct RenderGameOfLife
vtkm::Vec<float, 3> spacing(0.0075f, 0.0075f, 0.0f);
vtkm::cont::ArrayHandleUniformPointCoordinates coords(dimensions, origin, spacing);
vtkm::interop::TransferToOpenGL(coords, this->VBOState, vtkm::cont::DeviceAdapterTagSerial());
vtkm::interop::TransferToOpenGL(coords, this->VBOState);
}
void render(vtkm::cont::DataSet& data)
......@@ -240,7 +240,7 @@ struct RenderGameOfLife
}
};
vtkm::cont::Timer gTimer{ vtkm::cont::DeviceAdapterTagSerial() };
vtkm::cont::Timer gTimer;
vtkm::cont::DataSet* gData = nullptr;
GameOfLife* gFilter = nullptr;
RenderGameOfLife* gRenderer = nullptr;
......
......@@ -318,11 +318,11 @@ vtkm::Float64 Timer::GetElapsedTime(vtkm::cont::DeviceAdapterId device) const
// If we have specified a specific device, make sure we can run on it.
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
if ((deviceToTime != vtkm::cont::DeviceAdapterTagAny()) && !tracker.CanRunOn(deviceToTime))
if (deviceToTime != vtkm::cont::DeviceAdapterTagAny() && !tracker.CanRunOn(deviceToTime))
{
VTKM_LOG_S(vtkm::cont::LogLevel::Error,
"Device '" << device.GetName() << "' can not run on current Device."
"Thus timer is not usable");
"Device '" << deviceToTime.GetName() << "' can not run on current Device."
" Thus timer is not usable");
return 0.0;
}
......
......@@ -106,6 +106,13 @@ void TestBoundingIntervalHierarchy(vtkm::cont::DataSet dataSet, vtkm::IdComponen
void RunTest()
{
//If this test is run on a machine that already has heavy
//cpu usage it will fail, so we limit the number of threads
//to avoid the test timing out
#ifdef VTKM_ENABLE_OPENMP
omp_set_num_threads(std::min(4, omp_get_max_threads()));
#endif
TestBoundingIntervalHierarchy(ConstructDataSet(16), 3);
TestBoundingIntervalHierarchy(ConstructDataSet(16), 4);
TestBoundingIntervalHierarchy(ConstructDataSet(16), 6);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment