Commit 3cbac038 authored by Robert Maynard's avatar Robert Maynard
Browse files

Update the name of the binary functor Unique

parent e6cadef4
......@@ -522,17 +522,18 @@ private:
return static_cast<vtkm::Id>( ::thrust::distance(begin, newLast) );
}
template<class ValuesPortal, class Compare>
template<class ValuesPortal, class BinaryCompare>
VTKM_CONT_EXPORT static
vtkm::Id UniquePortal(const ValuesPortal values, Compare comp)
vtkm::Id UniquePortal(const ValuesPortal values, BinaryCompare binary_compare)
{
typedef typename detail::IteratorTraits<ValuesPortal>::IteratorType
IteratorType;
vtkm::exec::cuda::internal::WrappedBinaryOperator<bool,BinaryCompare> bop(binary_compare);
IteratorType begin = IteratorBegin(values);
IteratorType newLast = ::thrust::unique(thrust::cuda::par,
begin,
IteratorEnd(values),
comp);
bop);
return static_cast<vtkm::Id>( ::thrust::distance(begin, newLast) );
}
......@@ -977,12 +978,12 @@ public:
values.Shrink(newSize);
}
template<typename T, class Storage, class Compare>
template<typename T, class Storage, class BinaryCompare>
VTKM_CONT_EXPORT static void Unique(
vtkm::cont::ArrayHandle<T,Storage> &values,
Compare comp)
BinaryCompare binary_compare)
{
vtkm::Id newSize = UniquePortal(values.PrepareForInPlace(DeviceAdapterTag()),comp);
vtkm::Id newSize = UniquePortal(values.PrepareForInPlace(DeviceAdapterTag()),binary_compare);
values.Shrink(newSize);
}
......
......@@ -1238,20 +1238,20 @@ private:
{ }
};
template<class InputPortalType, class StencilPortalType, class Compare>
template<class InputPortalType, class StencilPortalType, class BinaryCompare>
struct ClassifyUniqueComparisonKernel
{
InputPortalType InputPortal;
StencilPortalType StencilPortal;
Compare CompareFunctor;
BinaryCompare CompareFunctor;
VTKM_CONT_EXPORT
ClassifyUniqueComparisonKernel(InputPortalType inputPortal,
StencilPortalType stencilPortal,
Compare comp):
BinaryCompare binary_compare):
InputPortal(inputPortal),
StencilPortal(stencilPortal),
CompareFunctor(comp) { }
CompareFunctor(binary_compare) { }
VTKM_EXEC_EXPORT
void operator()(vtkm::Id index) const
......@@ -1301,10 +1301,10 @@ public:
DerivedAlgorithm::Copy(outputArray, values);
}
template<typename T, class Storage, class Compare>
template<typename T, class Storage, class BinaryCompare>
VTKM_CONT_EXPORT static void Unique(
vtkm::cont::ArrayHandle<T,Storage> &values,
Compare comp)
BinaryCompare binary_compare)
{
vtkm::cont::ArrayHandle<vtkm::Id, vtkm::cont::StorageTagBasic>
stencilArray;
......@@ -1313,10 +1313,10 @@ public:
ClassifyUniqueComparisonKernel<
typename vtkm::cont::ArrayHandle<T,Storage>::template ExecutionTypes<DeviceAdapterTag>::PortalConst,
typename vtkm::cont::ArrayHandle<vtkm::Id,vtkm::cont::StorageTagBasic>::template ExecutionTypes<DeviceAdapterTag>::Portal,
Compare>
BinaryCompare>
classifyKernel(values.PrepareForInput(DeviceAdapterTag()),
stencilArray.PrepareForOutput(inputSize, DeviceAdapterTag()),
comp);
binary_compare);
DerivedAlgorithm::Schedule(classifyKernel, inputSize);
vtkm::cont::ArrayHandle<T, vtkm::cont::StorageTagBasic>
......
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