Commit c631dccf authored by Robert Maynard's avatar Robert Maynard

Invocation parameters are now non const and can be 'modified'

The invocation parameters need to be non const as we want to
be able to call non-const methods like `PrepareForOutput` on them
from a transport function.

The original implementation abused the fact that everything
could be copied by value and have that work properly. But
when we start introducing virtual classes copying by value of
a base type can cause type slicing.
parent 9238cedc
......@@ -600,7 +600,7 @@ public:
///
template <typename Transform>
VTKM_CONT typename StaticTransformType<Transform>::type StaticTransformCont(
const Transform& transform) const
const Transform& transform)
{
typename StaticTransformType<Transform>::type newFuncInterface;
detail::DoStaticTransformCont(transform, this->Parameters, newFuncInterface.Parameters);
......@@ -608,7 +608,7 @@ public:
}
template <typename Transform>
VTKM_EXEC typename StaticTransformType<Transform>::type StaticTransformExec(
const Transform& transform) const
const Transform& transform)
{
typename StaticTransformType<Transform>::type newFuncInterface;
detail::DoStaticTransformExec(transform, this->Parameters, newFuncInterface.Parameters);
......
This diff is collapsed.
......@@ -329,7 +329,7 @@ template <typename Transform,
$template_params(num_params,0,'Transformed')>
VTKM_$(environment.upper()) void DoStaticTransform$(environment)(
const Transform& transform,
const ParameterContainer<$signature(num_params,ptype(0,'Original'),'Original')>& originalParameters,
ParameterContainer<$signature(num_params,ptype(0,'Original'),'Original')>& originalParameters,
ParameterContainer<$signature(num_params,ptype(0,'Transformed'),'Transformed')>& transformedParameters)
{
$if(num_params < 1)\
......
......@@ -265,7 +265,7 @@ struct Invocation
/// over to CUDA it gets properly copied to the device. While we want to
/// hold by reference to reduce the number of copies, it is not possible
/// currently.
const ParameterInterface Parameters;
ParameterInterface Parameters;
OutputToInputMapType OutputToInputMap;
VisitArrayType VisitArray;
......
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