Do not return a reference from ImplicitFunction::PrepareForExecution

This can cause many troubles when passing around in a Variant
or across devices.
This commit is contained in:
Kenneth Moreland 2021-02-23 17:34:47 -07:00
parent b0fcab5d7f
commit 6a445ebcf0

@ -83,16 +83,12 @@ public:
return reinterpret_cast<const Derived*>(this)->Gradient(Vector(x, y, z));
}
VTKM_CONT const Derived& PrepareForExecution(vtkm::cont::DeviceAdapterId,
vtkm::cont::Token&) const
VTKM_CONT Derived PrepareForExecution(vtkm::cont::DeviceAdapterId, vtkm::cont::Token&) const
{
return *reinterpret_cast<const Derived*>(this);
}
VTKM_CONT const Derived& PrepareForControl() const
{
return *reinterpret_cast<const Derived*>(this);
}
VTKM_CONT Derived PrepareForControl() const { return *reinterpret_cast<const Derived*>(this); }
};
} // namespace vtkm::internal