Commit 9ccf982a authored by Kenneth Moreland's avatar Kenneth Moreland
Browse files

Remove direct usage of VTK-m in LOD test

The direct use of VTK-m was to switch the device being used.

TODO: add a means of specifying the device a VTK-m filter in
vtkAcceleratorsVTKm should use without directly interfacing with VTK-m.
parent ec591255
......@@ -13,6 +13,11 @@
=========================================================================*/
// Uncomment this to directly compare serial and TBB versions
// #define FORCE_VTKM_DEVICE
// TODO: Make a way to force the VTK-m device without actually loading VTK-m
// headers (and all subsequent dependent headers).
#include "vtkActor.h"
#include "vtkCamera.h"
......@@ -46,11 +51,15 @@
#include "vtkWindowToImageFilter.h"
#include "vtkXMLPolyDataReader.h"
#ifdef FORCE_VTKM_DEVICE
#include <vtkm/cont/RuntimeDeviceTracker.h>
#include <vtkm/cont/serial/DeviceAdapterSerial.h>
#include <vtkm/cont/tbb/DeviceAdapterTBB.h>
#endif // FORCE_VTKM_DEVICE
#include <iomanip>
#include <sstream>
......@@ -298,6 +307,8 @@ void RunBenchmark(int gridSize)
#endif
}
#ifdef FORCE_VTKM_DEVICE
vtkm::cont::RuntimeDeviceTracker tracker =
vtkm::cont::GetGlobalRuntimeDeviceTracker();
......@@ -326,6 +337,19 @@ void RunBenchmark(int gridSize)
}
#endif // VTKM_ENABLE_TBB
#else // !FORCE_VTKM_DEVICE
// Run VTKm
vtkSmartPointer<vtkPolyData> vtkmResult;
double vtkmTime = 0.;
{
VTKmFilterGenerator generator(gridSize);
vtkmTime = BenchmarkFilter(generator, input);
vtkmResult = generator.Result;
}
#endif
// Run VTK -- average clustered points
vtkSmartPointer<vtkPolyData> vtkResultAvePts;
double vtkTimeAvePts = 0.;
......@@ -349,6 +373,8 @@ void RunBenchmark(int gridSize)
<< "Input dataset has " << input->GetNumberOfPoints() << " points "
"and " << input->GetNumberOfCells() << " cells.\n";
#ifdef FORCE_VTKM_DEVICE
std::cerr << "vtkmLevelOfDetail (serial, average clustered points): "
<< vtkmTimeSerial << " seconds, "
<< vtkmResultSerial->GetNumberOfPoints() << " points, "
......@@ -364,6 +390,15 @@ void RunBenchmark(int gridSize)
}
#endif // VTKM_ENABLE_TBB
#else // !FORCE_VTKM_DEVICE
std::cerr << "vtkmLevelOfDetail (average clustered points): "
<< vtkmTime << " seconds, "
<< vtkmResult->GetNumberOfPoints() << " points, "
<< vtkmResult->GetNumberOfCells() << " cells.\n";
#endif // !FORCE_VTKM_DEVICE
std::cerr << "vtkQuadricClustering (average clustered points): "
<< vtkTimeAvePts << " seconds, "
<< vtkResultAvePts->GetNumberOfPoints() << " points, "
......@@ -373,11 +408,17 @@ void RunBenchmark(int gridSize)
<< vtkResult->GetNumberOfPoints() << " points, "
<< vtkResult->GetNumberOfCells() << " cells.\n";
#ifdef FORCE_VTKM_DEVICE
#ifdef VTKM_ENABLE_TBB
RenderResults(gridSize, input,
vtkmTimeTBB, vtkmResultTBB,
vtkTime, vtkResult);
#endif // VTKM_ENABLE_TBB
#else // !FORCE_VTKM_DEVICE
RenderResults(gridSize, input,
vtkmTime, vtkmResult,
vtkTime, vtkResult);
#endif // !FORCE_VTKM_DEVICE
}
void RunBenchmarks()
......
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