Commit 604289c1 authored by Robert Maynard's avatar Robert Maynard
Browse files

Update the name of the binary functor for ScanInclusive

parent 8ba0dacc
......@@ -405,14 +405,14 @@ private:
return ScanInclusivePortal(input, output, ::thrust::plus<ValueType>() );
}
template<class InputPortal, class OutputPortal, class BinaryOperation>
template<class InputPortal, class OutputPortal, class BinaryFunctor>
VTKM_CONT_EXPORT static
typename InputPortal::ValueType ScanInclusivePortal(const InputPortal &input,
const OutputPortal &output,
BinaryOperation binaryOp)
BinaryFunctor binary_functor)
{
vtkm::exec::cuda::internal::WrappedBinaryOperator<typename InputPortal::ValueType,
BinaryOperation> bop(binaryOp);
BinaryFunctor> bop(binary_functor);
typedef typename detail::IteratorTraits<OutputPortal>::IteratorType
IteratorType;
......@@ -733,11 +733,11 @@ public:
output.PrepareForOutput(numberOfValues, DeviceAdapterTag()));
}
template<typename T, class SIn, class SOut, class BinaryOperation>
template<typename T, class SIn, class SOut, class BinaryFunctor>
VTKM_CONT_EXPORT static T ScanInclusive(
const vtkm::cont::ArrayHandle<T,SIn> &input,
vtkm::cont::ArrayHandle<T,SOut>& output,
BinaryOperation binaryOp)
BinaryFunctor binary_functor)
{
const vtkm::Id numberOfValues = input.GetNumberOfValues();
if (numberOfValues <= 0)
......@@ -753,7 +753,7 @@ public:
input.PrepareForInput(DeviceAdapterTag());
return ScanInclusivePortal(input.PrepareForInput(DeviceAdapterTag()),
output.PrepareForOutput(numberOfValues, DeviceAdapterTag()),
binaryOp);
binary_functor);
}
// Because of some funny code conversions in nvcc, kernels for devices have to
......
......@@ -764,20 +764,20 @@ public:
//--------------------------------------------------------------------------
// Scan Inclusive
private:
template<typename PortalType, typename BinaryOperation>
template<typename PortalType, typename BinaryFunctor>
struct ScanKernel : vtkm::exec::FunctorBase
{
PortalType Portal;
BinaryOperation BinaryOperator;
BinaryFunctor BinaryOperator;
vtkm::Id Stride;
vtkm::Id Offset;
vtkm::Id Distance;
VTKM_CONT_EXPORT
ScanKernel(const PortalType &portal, BinaryOperation binaryOp,
ScanKernel(const PortalType &portal, BinaryFunctor binary_functor,
vtkm::Id stride, vtkm::Id offset)
: Portal(portal),
BinaryOperator(binaryOp),
BinaryOperator(binary_functor),
Stride(stride),
Offset(offset),
Distance(stride/2)
......@@ -811,17 +811,17 @@ public:
vtkm::internal::Add());
}
template<typename T, class CIn, class COut, class BinaryOperation>
template<typename T, class CIn, class COut, class BinaryFunctor>
VTKM_CONT_EXPORT static T ScanInclusive(
const vtkm::cont::ArrayHandle<T,CIn> &input,
vtkm::cont::ArrayHandle<T,COut>& output,
BinaryOperation binaryOp)
BinaryFunctor binary_functor)
{
typedef typename
vtkm::cont::ArrayHandle<T,COut>
::template ExecutionTypes<DeviceAdapterTag>::Portal PortalType;
typedef ScanKernel<PortalType,BinaryOperation> ScanKernelType;
typedef ScanKernel<PortalType,BinaryFunctor> ScanKernelType;
DerivedAlgorithm::Copy(input, output);
......@@ -836,14 +836,14 @@ public:
vtkm::Id stride;
for (stride = 2; stride-1 < numValues; stride *= 2)
{
ScanKernelType kernel(portal, binaryOp, stride, stride/2 - 1);
ScanKernelType kernel(portal, binary_functor, stride, stride/2 - 1);
DerivedAlgorithm::Schedule(kernel, numValues/stride);
}
// Do reverse operation on odd indices. Start at stride we were just at.
for (stride /= 2; stride > 1; stride /= 2)
{
ScanKernelType kernel(portal, binaryOp, stride, stride - 1);
ScanKernelType kernel(portal, binary_functor, stride, stride - 1);
DerivedAlgorithm::Schedule(kernel, numValues/stride);
}
......
......@@ -161,19 +161,19 @@ public:
return outputPortal.Get(numberOfValues - 1);
}
template<typename T, class CIn, class COut, class BinaryOperation>
template<typename T, class CIn, class COut, class BinaryFunctor>
VTKM_CONT_EXPORT static T ScanInclusive(
const vtkm::cont::ArrayHandle<T,CIn> &input,
vtkm::cont::ArrayHandle<T,COut>& output,
BinaryOperation binaryOp)
BinaryFunctor binary_functor)
{
typedef typename vtkm::cont::ArrayHandle<T,COut>
::template ExecutionTypes<Device>::Portal PortalOut;
typedef typename vtkm::cont::ArrayHandle<T,CIn>
::template ExecutionTypes<Device>::PortalConst PortalIn;
internal::WrappedBinaryOperator<T,BinaryOperation> wrappedBinaryOp(
binaryOp);
internal::WrappedBinaryOperator<T,BinaryFunctor> wrappedBinaryOp(
binary_functor);
vtkm::Id numberOfValues = input.GetNumberOfValues();
......
......@@ -311,16 +311,16 @@ public:
vtkm::cont::DeviceAdapterTagTBB()), vtkm::internal::Add());
}
template<typename T, class CIn, class COut, class BinaryOperation>
template<typename T, class CIn, class COut, class BinaryFunctor>
VTKM_CONT_EXPORT static T ScanInclusive(
const vtkm::cont::ArrayHandle<T,CIn> &input,
vtkm::cont::ArrayHandle<T,COut> &output,
BinaryOperation binaryOp)
BinaryFunctor binary_functor)
{
return ScanInclusivePortals(
input.PrepareForInput(vtkm::cont::DeviceAdapterTagTBB()),
output.PrepareForOutput(input.GetNumberOfValues(),
vtkm::cont::DeviceAdapterTagTBB()), binaryOp);
vtkm::cont::DeviceAdapterTagTBB()), binary_functor);
}
template<typename T, class CIn, class COut>
......@@ -334,16 +334,16 @@ public:
vtkm::cont::DeviceAdapterTagTBB()), vtkm::internal::Add());
}
template<typename T, class CIn, class COut, class BinaryOperation>
template<typename T, class CIn, class COut, class BinaryFunctor>
VTKM_CONT_EXPORT static T ScanExclusive(
const vtkm::cont::ArrayHandle<T,CIn> &input,
vtkm::cont::ArrayHandle<T,COut> &output,
BinaryOperation binaryOp)
BinaryFunctor binary_functor)
{
return ScanExclusivePortals(
input.PrepareForInput(vtkm::cont::DeviceAdapterTagTBB()),
output.PrepareForOutput(input.GetNumberOfValues(),
vtkm::cont::DeviceAdapterTagTBB()), binaryOp);
vtkm::cont::DeviceAdapterTagTBB()), binary_functor);
}
private:
......
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