Commit 70fcd1d1 authored by Sujin Philip's avatar Sujin Philip
Browse files

Update CoordinateSystem to use the Virtual Array

parent 950b12b1
...@@ -104,14 +104,11 @@ int main(int argc, char* argv[]) ...@@ -104,14 +104,11 @@ int main(int argc, char* argv[])
output.AddCellSet(outputCellSet); output.AddCellSet(outputCellSet);
auto inCoords = input.GetCoordinateSystem(0).GetData();
timer.Reset(); timer.Reset();
vtkm::cont::DynamicArrayHandle coords; auto outCoords = clip.ProcessCellField(inCoords, DeviceAdapter());
{
FieldMapper<DeviceAdapter> coordMapper(coords, clip, false);
input.GetCoordinateSystem(0).GetData().CastAndCall(coordMapper);
}
vtkm::Float64 processCoordinatesTime = timer.GetElapsedTime(); vtkm::Float64 processCoordinatesTime = timer.GetElapsedTime();
output.AddCoordinateSystem(vtkm::cont::CoordinateSystem("coordinates", coords)); output.AddCoordinateSystem(vtkm::cont::CoordinateSystem("coordinates", outCoords));
timer.Reset(); timer.Reset();
for (vtkm::Id i = 0; i < input.GetNumberOfFields(); ++i) for (vtkm::Id i = 0; i < input.GetNumberOfFields(); ++i)
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#endif #endif
#include <vtkm/Math.h> #include <vtkm/Math.h>
#include <vtkm/cont/ArrayCopy.h>
#include <vtkm/cont/ArrayHandle.h> #include <vtkm/cont/ArrayHandle.h>
#include <vtkm/cont/DataSet.h> #include <vtkm/cont/DataSet.h>
#include <vtkm/worklet/DispatcherMapField.h> #include <vtkm/worklet/DispatcherMapField.h>
...@@ -68,30 +69,6 @@ Quaternion qrot; ...@@ -68,30 +69,6 @@ Quaternion qrot;
int lastx, lasty; int lastx, lasty;
int mouse_state = 1; int mouse_state = 1;
//
// Functor to retrieve vertex locations from the CoordinateSystem
// Actually need a static cast to ArrayHandle from DynamicArrayHandleCoordinateSystem
// but haven't been able to figure out what that is
//
struct GetVertexArray
{
template <typename ArrayHandleType>
VTKM_CONT void operator()(ArrayHandleType array) const
{
this->GetVertexPortal(array.GetPortalConstControl());
}
private:
template <typename PortalType>
VTKM_CONT void GetVertexPortal(const PortalType& portal) const
{
for (vtkm::Id index = 0; index < portal.GetNumberOfValues(); index++)
{
vertexArray.GetPortalControl().Set(index, portal.Get(index));
}
}
};
// //
// Initialize the OpenGL state // Initialize the OpenGL state
// //
...@@ -145,16 +122,10 @@ void displayCall() ...@@ -145,16 +122,10 @@ void displayCall()
// Get the cell set, coordinate system and coordinate data // Get the cell set, coordinate system and coordinate data
vtkm::cont::CellSetExplicit<> cellSet; vtkm::cont::CellSetExplicit<> cellSet;
outDataSet.GetCellSet(0).CopyTo(cellSet); outDataSet.GetCellSet(0).CopyTo(cellSet);
const vtkm::cont::DynamicArrayHandleCoordinateSystem& coordArray = auto coordArray = outDataSet.GetCoordinateSystem().GetData();
outDataSet.GetCoordinateSystem().GetData();
vtkm::Id numberOfCells = cellSet.GetNumberOfCells(); vtkm::Id numberOfCells = cellSet.GetNumberOfCells();
vtkm::Id numberOfPoints = coordArray.GetNumberOfValues(); vtkm::cont::ArrayCopy(coordArray, vertexArray);
// Need the actual vertex points from a static cast of the dynamic array but can't get it right
// So use cast and call on a functor that stores that dynamic array into static array we created
vertexArray.Allocate(numberOfPoints);
vtkm::cont::CastAndCall(coordArray, GetVertexArray());
// Each cell is a polyline // Each cell is a polyline
glColor3f(1.0f, 0.0f, 0.0f); glColor3f(1.0f, 0.0f, 0.0f);
......
...@@ -52,9 +52,6 @@ namespace ...@@ -52,9 +52,6 @@ namespace
// Takes input uniform grid and outputs unstructured grid of tets // Takes input uniform grid and outputs unstructured grid of tets
static vtkm::cont::DataSet outDataSet; static vtkm::cont::DataSet outDataSet;
// Point location of vertices from a CastAndCall but needs a static cast eventually
static vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::Float64, 3>> vertexArray;
// OpenGL display variables // OpenGL display variables
Quaternion qrot; Quaternion qrot;
int lastx, lasty; int lastx, lasty;
...@@ -123,30 +120,6 @@ vtkm::cont::DataSet MakeTetrahedralizeExplicitDataSet() ...@@ -123,30 +120,6 @@ vtkm::cont::DataSet MakeTetrahedralizeExplicitDataSet()
return builder.Create(); return builder.Create();
} }
//
// Functor to retrieve vertex locations from the CoordinateSystem
// Actually need a static cast to ArrayHandle from DynamicArrayHandleCoordinateSystem
// but haven't been able to figure out what that is
//
struct GetVertexArray
{
template <typename ArrayHandleType>
VTKM_CONT void operator()(ArrayHandleType array) const
{
this->GetVertexPortal(array.GetPortalConstControl());
}
private:
template <typename PortalType>
VTKM_CONT void GetVertexPortal(const PortalType& portal) const
{
for (vtkm::Id index = 0; index < portal.GetNumberOfValues(); index++)
{
vertexArray.GetPortalControl().Set(index, portal.Get(index));
}
}
};
// //
// Initialize the OpenGL state // Initialize the OpenGL state
// //
...@@ -201,10 +174,7 @@ void displayCall() ...@@ -201,10 +174,7 @@ void displayCall()
outDataSet.GetCellSet(0).CopyTo(cellSet); outDataSet.GetCellSet(0).CopyTo(cellSet);
vtkm::Id numberOfCells = cellSet.GetNumberOfCells(); vtkm::Id numberOfCells = cellSet.GetNumberOfCells();
// Need the actual vertex points from a static cast of the dynamic array but can't get it right auto vertexArray = outDataSet.GetCoordinateSystem().GetData();
// So use cast and call on a functor that stores that dynamic array into static array we created
vertexArray.Allocate(cellSet.GetNumberOfPoints());
vtkm::cont::CastAndCall(outDataSet.GetCoordinateSystem(), GetVertexArray());
// Draw the five tetrahedra belonging to each hexadron // Draw the five tetrahedra belonging to each hexadron
vtkm::Float32 color[5][3] = { { 1.0f, 0.0f, 0.0f }, vtkm::Float32 color[5][3] = { { 1.0f, 0.0f, 0.0f },
...@@ -223,10 +193,10 @@ void displayCall() ...@@ -223,10 +193,10 @@ void displayCall()
cellSet.GetIndices(tetra, tetIndices); cellSet.GetIndices(tetra, tetIndices);
// Get the vertex points for this tetrahedron // Get the vertex points for this tetrahedron
vtkm::Vec<vtkm::Float64, 3> pt0 = vertexArray.GetPortalConstControl().Get(tetIndices[0]); auto pt0 = vertexArray.GetPortalConstControl().Get(tetIndices[0]);
vtkm::Vec<vtkm::Float64, 3> pt1 = vertexArray.GetPortalConstControl().Get(tetIndices[1]); auto pt1 = vertexArray.GetPortalConstControl().Get(tetIndices[1]);
vtkm::Vec<vtkm::Float64, 3> pt2 = vertexArray.GetPortalConstControl().Get(tetIndices[2]); auto pt2 = vertexArray.GetPortalConstControl().Get(tetIndices[2]);
vtkm::Vec<vtkm::Float64, 3> pt3 = vertexArray.GetPortalConstControl().Get(tetIndices[3]); auto pt3 = vertexArray.GetPortalConstControl().Get(tetIndices[3]);
// Draw the tetrahedron filled with alternating colors // Draw the tetrahedron filled with alternating colors
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
...@@ -323,7 +293,6 @@ int main(int argc, char* argv[]) ...@@ -323,7 +293,6 @@ int main(int argc, char* argv[])
glutMainLoop(); glutMainLoop();
outDataSet.Clear(); outDataSet.Clear();
vertexArray.ReleaseResources();
return 0; return 0;
} }
......
...@@ -52,9 +52,6 @@ static vtkm::Id cellsToDisplay = 64; ...@@ -52,9 +52,6 @@ static vtkm::Id cellsToDisplay = 64;
// Takes input uniform grid and outputs unstructured grid of tets // Takes input uniform grid and outputs unstructured grid of tets
static vtkm::cont::DataSet tetDataSet; static vtkm::cont::DataSet tetDataSet;
// Point location of vertices from a CastAndCall but needs a static cast eventually
static vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::Float64, 3>> vertexArray;
// OpenGL display variables // OpenGL display variables
static Quaternion qrot; static Quaternion qrot;
static int lastx, lasty; static int lastx, lasty;
...@@ -87,30 +84,6 @@ vtkm::cont::DataSet MakeTetrahedralizeTestDataSet(vtkm::Id3 dim) ...@@ -87,30 +84,6 @@ vtkm::cont::DataSet MakeTetrahedralizeTestDataSet(vtkm::Id3 dim)
return dataSet; return dataSet;
} }
//
// Functor to retrieve vertex locations from the CoordinateSystem
// Actually need a static cast to ArrayHandle from DynamicArrayHandleCoordinateSystem
// but haven't been able to figure out what that is
//
struct GetVertexArray
{
template <typename ArrayHandleType>
VTKM_CONT void operator()(ArrayHandleType array) const
{
this->GetVertexPortal(array.GetPortalConstControl());
}
private:
template <typename PortalType>
VTKM_CONT void GetVertexPortal(const PortalType& portal) const
{
for (vtkm::Id index = 0; index < portal.GetNumberOfValues(); index++)
{
vertexArray.GetPortalControl().Set(index, portal.Get(index));
}
}
};
// //
// Initialize the OpenGL state // Initialize the OpenGL state
// //
...@@ -165,10 +138,7 @@ void displayCall() ...@@ -165,10 +138,7 @@ void displayCall()
vtkm::cont::CellSetSingleType<> cellSet; vtkm::cont::CellSetSingleType<> cellSet;
tetDataSet.GetCellSet(0).CopyTo(cellSet); tetDataSet.GetCellSet(0).CopyTo(cellSet);
// Need the actual vertex points from a static cast of the dynamic array but can't get it right auto vertexArray = tetDataSet.GetCoordinateSystem().GetData();
// So use cast and call on a functor that stores that dynamic array into static array we created
vertexArray.Allocate(cellSet.GetNumberOfPoints());
vtkm::cont::CastAndCall(tetDataSet.GetCoordinateSystem(), GetVertexArray());
// Draw the five tetrahedra belonging to each hexadron // Draw the five tetrahedra belonging to each hexadron
vtkm::Id tetra = 0; vtkm::Id tetra = 0;
...@@ -190,10 +160,10 @@ void displayCall() ...@@ -190,10 +160,10 @@ void displayCall()
cellSet.GetIndices(tetra, tetIndices); cellSet.GetIndices(tetra, tetIndices);
// Get the vertex points for this tetrahedron // Get the vertex points for this tetrahedron
vtkm::Vec<vtkm::Float64, 3> pt0 = vertexArray.GetPortalConstControl().Get(tetIndices[0]); auto pt0 = vertexArray.GetPortalConstControl().Get(tetIndices[0]);
vtkm::Vec<vtkm::Float64, 3> pt1 = vertexArray.GetPortalConstControl().Get(tetIndices[1]); auto pt1 = vertexArray.GetPortalConstControl().Get(tetIndices[1]);
vtkm::Vec<vtkm::Float64, 3> pt2 = vertexArray.GetPortalConstControl().Get(tetIndices[2]); auto pt2 = vertexArray.GetPortalConstControl().Get(tetIndices[2]);
vtkm::Vec<vtkm::Float64, 3> pt3 = vertexArray.GetPortalConstControl().Get(tetIndices[3]); auto pt3 = vertexArray.GetPortalConstControl().Get(tetIndices[3]);
// Draw the tetrahedron filled with alternating colors // Draw the tetrahedron filled with alternating colors
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
...@@ -305,7 +275,6 @@ int main(int argc, char* argv[]) ...@@ -305,7 +275,6 @@ int main(int argc, char* argv[])
glutMainLoop(); glutMainLoop();
tetDataSet.Clear(); tetDataSet.Clear();
vertexArray.ReleaseResources();
return 0; return 0;
} }
......
...@@ -50,9 +50,6 @@ namespace ...@@ -50,9 +50,6 @@ namespace
static vtkm::cont::DataSet outDataSet; static vtkm::cont::DataSet outDataSet;
static vtkm::Id numberOfInPoints; static vtkm::Id numberOfInPoints;
// Point location of vertices from a CastAndCall but needs a static cast eventually
static vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::Float64, 3>> vertexArray;
} // anonymous namespace } // anonymous namespace
// //
...@@ -125,30 +122,6 @@ vtkm::cont::DataSet MakeTriangulateExplicitDataSet() ...@@ -125,30 +122,6 @@ vtkm::cont::DataSet MakeTriangulateExplicitDataSet()
return builder.Create(); return builder.Create();
} }
//
// Functor to retrieve vertex locations from the CoordinateSystem
// Actually need a static cast to ArrayHandle from DynamicArrayHandleCoordinateSystem
// but haven't been able to figure out what that is
//
struct GetVertexArray
{
template <typename ArrayHandleType>
VTKM_CONT void operator()(ArrayHandleType array) const
{
this->GetVertexPortal(array.GetPortalConstControl());
}
private:
template <typename PortalType>
VTKM_CONT void GetVertexPortal(const PortalType& portal) const
{
for (vtkm::Id index = 0; index < portal.GetNumberOfValues(); index++)
{
vertexArray.GetPortalControl().Set(index, portal.Get(index));
}
}
};
// //
// Initialize the OpenGL state // Initialize the OpenGL state
// //
...@@ -173,10 +146,7 @@ void displayCall() ...@@ -173,10 +146,7 @@ void displayCall()
outDataSet.GetCellSet(0).CopyTo(cellSet); outDataSet.GetCellSet(0).CopyTo(cellSet);
vtkm::Id numberOfCells = cellSet.GetNumberOfCells(); vtkm::Id numberOfCells = cellSet.GetNumberOfCells();
// Need the actual vertex points from a static cast of the dynamic array but can't get it right auto vertexArray = outDataSet.GetCoordinateSystem().GetData();
// So use cast and call on a functor that stores that dynamic array into static array we created
vertexArray.Allocate(numberOfInPoints);
vtkm::cont::CastAndCall(outDataSet.GetCoordinateSystem(), GetVertexArray());
// Draw the two triangles belonging to each quad // Draw the two triangles belonging to each quad
vtkm::Float32 color[4][3] = { vtkm::Float32 color[4][3] = {
...@@ -239,7 +209,6 @@ int main(int argc, char* argv[]) ...@@ -239,7 +209,6 @@ int main(int argc, char* argv[])
glutMainLoop(); glutMainLoop();
outDataSet.Clear(); outDataSet.Clear();
vertexArray.ReleaseResources();
return 0; return 0;
} }
......
...@@ -50,9 +50,6 @@ static vtkm::Id cellsToDisplay = 16; ...@@ -50,9 +50,6 @@ static vtkm::Id cellsToDisplay = 16;
// Takes input uniform grid and outputs unstructured grid of triangles // Takes input uniform grid and outputs unstructured grid of triangles
static vtkm::cont::DataSet triDataSet; static vtkm::cont::DataSet triDataSet;
// Point location of vertices from a CastAndCall but needs a static cast eventually
static vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::Float64, 3>> vertexArray;
// //
// Construct an input data set with uniform grid of indicated dimensions, origin and spacing // Construct an input data set with uniform grid of indicated dimensions, origin and spacing
// //
...@@ -78,30 +75,6 @@ vtkm::cont::DataSet MakeTriangulateTestDataSet(vtkm::Id2 dim) ...@@ -78,30 +75,6 @@ vtkm::cont::DataSet MakeTriangulateTestDataSet(vtkm::Id2 dim)
return dataSet; return dataSet;
} }
//
// Functor to retrieve vertex locations from the CoordinateSystem
// Actually need a static cast to ArrayHandle from DynamicArrayHandleCoordinateSystem
// but haven't been able to figure out what that is
//
struct GetVertexArray
{
template <typename ArrayHandleType>
VTKM_CONT void operator()(ArrayHandleType array) const
{
this->GetVertexPortal(array.GetPortalConstControl());
}
private:
template <typename PortalType>
VTKM_CONT void GetVertexPortal(const PortalType& portal) const
{
for (vtkm::Id index = 0; index < portal.GetNumberOfValues(); index++)
{
vertexArray.GetPortalControl().Set(index, portal.Get(index));
}
}
};
// //
// Initialize the OpenGL state // Initialize the OpenGL state
// //
...@@ -125,10 +98,7 @@ void displayCall() ...@@ -125,10 +98,7 @@ void displayCall()
vtkm::cont::CellSetSingleType<> cellSet; vtkm::cont::CellSetSingleType<> cellSet;
triDataSet.GetCellSet(0).CopyTo(cellSet); triDataSet.GetCellSet(0).CopyTo(cellSet);
// Need the actual vertex points from a static cast of the dynamic array but can't get it right auto vertexArray = triDataSet.GetCoordinateSystem().GetData();
// So use cast and call on a functor that stores that dynamic array into static array we created
vertexArray.Allocate(cellSet.GetNumberOfPoints());
vtkm::cont::CastAndCall(triDataSet.GetCoordinateSystem(), GetVertexArray());
// Draw the two triangles belonging to each quad // Draw the two triangles belonging to each quad
vtkm::Id triangle = 0; vtkm::Id triangle = 0;
...@@ -207,7 +177,6 @@ int main(int argc, char* argv[]) ...@@ -207,7 +177,6 @@ int main(int argc, char* argv[])
glutMainLoop(); glutMainLoop();
triDataSet.Clear(); triDataSet.Clear();
vertexArray.ReleaseResources();
return 0; return 0;
} }
......
...@@ -71,6 +71,10 @@ VTKM_ARRAY_RANGE_COMPUTE_IMPL_VEC(vtkm::UInt8, 4, vtkm::cont::StorageTagBasic); ...@@ -71,6 +71,10 @@ VTKM_ARRAY_RANGE_COMPUTE_IMPL_VEC(vtkm::UInt8, 4, vtkm::cont::StorageTagBasic);
VTKM_ARRAY_RANGE_COMPUTE_IMPL_VEC(vtkm::Float32, 4, vtkm::cont::StorageTagBasic); VTKM_ARRAY_RANGE_COMPUTE_IMPL_VEC(vtkm::Float32, 4, vtkm::cont::StorageTagBasic);
VTKM_ARRAY_RANGE_COMPUTE_IMPL_VEC(vtkm::Float64, 4, vtkm::cont::StorageTagBasic); VTKM_ARRAY_RANGE_COMPUTE_IMPL_VEC(vtkm::Float64, 4, vtkm::cont::StorageTagBasic);
VTKM_ARRAY_RANGE_COMPUTE_IMPL_VEC(vtkm::FloatDefault,
3,
vtkm::cont::ArrayHandleVirtualCoordinates::StorageTag);
#undef VTKM_ARRAY_RANGE_COMPUTE_IMPL_T #undef VTKM_ARRAY_RANGE_COMPUTE_IMPL_T
#undef VTKM_ARRAY_RANGE_COMPUTE_IMPL_VEC #undef VTKM_ARRAY_RANGE_COMPUTE_IMPL_VEC
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <vtkm/cont/ArrayHandleCartesianProduct.h> #include <vtkm/cont/ArrayHandleCartesianProduct.h>
#include <vtkm/cont/ArrayHandleCompositeVector.h> #include <vtkm/cont/ArrayHandleCompositeVector.h>
#include <vtkm/cont/ArrayHandleUniformPointCoordinates.h> #include <vtkm/cont/ArrayHandleUniformPointCoordinates.h>
#include <vtkm/cont/ArrayHandleVirtualCoordinates.h>
#include <vtkm/cont/RuntimeDeviceTracker.h> #include <vtkm/cont/RuntimeDeviceTracker.h>
namespace vtkm namespace vtkm
...@@ -97,6 +98,10 @@ VTKM_ARRAY_RANGE_COMPUTE_EXPORT_VEC(vtkm::FloatDefault, ...@@ -97,6 +98,10 @@ VTKM_ARRAY_RANGE_COMPUTE_EXPORT_VEC(vtkm::FloatDefault,
3, 3,
vtkm::cont::ArrayHandleUniformPointCoordinates::StorageTag); vtkm::cont::ArrayHandleUniformPointCoordinates::StorageTag);
VTKM_ARRAY_RANGE_COMPUTE_EXPORT_VEC(vtkm::FloatDefault,
3,
vtkm::cont::ArrayHandleVirtualCoordinates::StorageTag);
#undef VTKM_ARRAY_RANGE_COMPUTE_EXPORT_T #undef VTKM_ARRAY_RANGE_COMPUTE_EXPORT_T
#undef VTKM_ARRAY_RANGE_COMPUTE_EXPORT_VEC #undef VTKM_ARRAY_RANGE_COMPUTE_EXPORT_VEC
......
...@@ -102,13 +102,10 @@ set(sources ...@@ -102,13 +102,10 @@ set(sources
CellSet.cxx CellSet.cxx
CellSetExplicit.cxx CellSetExplicit.cxx
CellSetStructured.cxx CellSetStructured.cxx
CoordinateSystem.cxx
DataSet.cxx
DynamicArrayHandle.cxx DynamicArrayHandle.cxx
EnvironmentTracker.cxx EnvironmentTracker.cxx
Field.cxx Field.cxx
internal/SimplePolymorphicContainer.cxx internal/SimplePolymorphicContainer.cxx
MultiBlock.cxx
internal/ArrayManagerExecutionShareWithControl.cxx internal/ArrayManagerExecutionShareWithControl.cxx
StorageBasic.cxx StorageBasic.cxx
) )
...@@ -118,6 +115,9 @@ set(sources ...@@ -118,6 +115,9 @@ set(sources
set(device_sources set(device_sources
ArrayRangeCompute.cxx ArrayRangeCompute.cxx
CellSetExplicit.cxx CellSetExplicit.cxx
CoordinateSystem.cxx
DataSet.cxx
MultiBlock.cxx
RuntimeDeviceTracker.cxx RuntimeDeviceTracker.cxx
TryExecute.cxx TryExecute.cxx
) )
......
...@@ -496,24 +496,17 @@ public: ...@@ -496,24 +496,17 @@ public:
/// Builds the cell locator lookup structure /// Builds the cell locator lookup structure
/// ///
template <typename DeviceAdapter, template <typename DeviceAdapter, typename CellSetList = VTKM_DEFAULT_CELL_SET_LIST_TAG>
typename CellSetList = VTKM_DEFAULT_CELL_SET_LIST_TAG, void Build(DeviceAdapter, CellSetList cellSetTypes = CellSetList())
typename CoordsTypeList = VTKM_DEFAULT_COORDINATE_SYSTEM_TYPE_LIST_TAG,
typename CoordsStorageList = VTKM_DEFAULT_COORDINATE_SYSTEM_STORAGE_LIST_TAG>
void Build(DeviceAdapter,
CellSetList cellSetTypes = CellSetList(),
CoordsTypeList coordsValueTypes = CoordsTypeList(),
CoordsStorageList coordsStorageType = CoordsStorageList())
{ {
using Algorithm = vtkm::cont::DeviceAdapterAlgorithm<DeviceAdapter>; using Algorithm = vtkm::cont::DeviceAdapterAlgorithm<DeviceAdapter>;
auto cellset = this->CellSet.ResetCellSetList(cellSetTypes); auto cellset = this->CellSet.ResetCellSetList(cellSetTypes);
auto points = const auto& coords = this->Coordinates;
this->Coordinates.GetData().ResetTypeAndStorageLists(coordsValueTypes, coordsStorageType);
TwoLevelUniformGrid ls; TwoLevelUniformGrid ls;
// 1: Compute the top level grid // 1: Compute the top level grid
auto bounds = this->Coordinates.GetBounds(coordsValueTypes, coordsStorageType); auto bounds = this->Coordinates.GetBounds();
FloatVec3 bmin(static_cast<vtkm::FloatDefault>(bounds.X.Min), FloatVec3 bmin(static_cast<vtkm::FloatDefault>(bounds.X.Min),
static_cast<vtkm::FloatDefault>(bounds.Y.Min), static_cast<vtkm::FloatDefault>(bounds.Y.Min),
static_cast<vtkm::FloatDefault>(bounds.Z.Min)); static_cast<vtkm::FloatDefault>(bounds.Z.Min));
...@@ -533,7 +526,7 @@ public: ...@@ -533,7 +526,7 @@ public:
vtkm::cont::ArrayHandle<vtkm::Id> binCounts; vtkm::cont::ArrayHandle<vtkm::Id> binCounts;
CountBinsL1 countL1(ls.TopLevel); CountBinsL1 countL1(ls.TopLevel);
vtkm::worklet::DispatcherMapTopology<CountBinsL1, DeviceAdapter>(countL1).Invoke( vtkm::worklet::DispatcherMapTopology<CountBinsL1, DeviceAdapter>(countL1).Invoke(
cellset, points, binCounts); cellset, coords, binCounts);
// 3: Total number of unique (cell, bin) pairs (for pre-allocating arrays) // 3: Total number of unique (cell, bin) pairs (for pre-allocating arrays)
vtkm::Id numPairsL1 = Algorithm::ScanExclusive(binCounts, binCounts); vtkm