When using ScatterPermutation with a dispatcher, the input size is checked against the input domain
In the following code, if the resize()
call is removed, a runtime error happens. It should not be necessary to set the size of the groundTruth
to the full domain size of the input.
std::vector<vtkm::Id3> groundTruth = {{2,8,0}, {8, 14, 0}};
groundTruth.resize(48);
vtkm::cont::ArrayHandle<bool> result;
auto cellSet = ds.GetCellSet(0).Cast<vtkm::cont::CellSetSingleType<> >();
std::vector<vtkm::Id> cellsToVisit;
cellsToVisit.push_back(0);
cellsToVisit.push_back(1);
vtkm::worklet::ScatterPermutation<> scatter(vtkm::cont::make_ArrayHandle(
cellsToVisit));
vtkm::worklet::DispatcherMapTopology<CheckTopology> dispatcher(scatter);
dispatcher.Invoke(cellSet, vtkm::cont::make_ArrayHandle(groundTruth), result);