Compile error for vtkm::cont:: Algorithm ::Reduce to sum ArrayHandle<vtkm::Id>
I'm encountering an unexpected compile error when using vtkm::cont:: Algorithm ::Reduce
for an ArrayHandle of type vtkm::Id
. Specifically, Example 34.8 from the user guide shows:
vtkm::cont:: ArrayHandle <vtkm::Int32 > input = vtkm::cont:: make_ArrayHandle <vtkm::Int32 >({ 5, 1, 1, 6 });
vtkm:: Int32 sum = vtkm::cont:: Algorithm :: Reduce(input , 0);
This works fine. But when simply changing the data type from vtkm::Int32 to vtkm::Id (which should be just an Int64 in this case) as follows:
vtkm::cont::ArrayHandle<vtkm::Id > input = vtkm::cont::make_ArrayHandle<vtkm::Id >({ 5, 1, 1, 6 });
vtkm::Id sum = vtkm::cont::Algorithm::Reduce(input , 0);
I get the compiler error:
...vtk-m/vtkm/cont/internal/FunctorsGeneral.h:52:12: error: no matching function for call to object of type 'const vtkm::Add'
return m_f(x, y);
Changing the call to use vtkm::Sum()
(which I assume does the same as add) fixes the error, i.e., the following compiles fine:
vtkm::cont::ArrayHandle<vtkm::Id > input = vtkm::cont::make_ArrayHandle<vtkm::Id >({ 5, 1, 1, 6 });
vtkm::Id sum = vtkm::cont::Algorithm::Reduce(input , 0, vtkm::Sum());