mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-08 13:23:51 +00:00
Merge topic 'correct_openmp_timeouts'
9c2920072 UnitTestBoundingIntervalHierarchy handles systems under load better 671c1df5c Timer logs the proper device name when called with an invalid device d3d66a331 GameOfLife example always uses the proper device adapter Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1645
This commit is contained in:
commit
2c026508b3
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user