Make offsets for ArrayHandleGroupVecVariable always input

The offsets for an ArrayHandleGroupVecVariable are always inputs
and cannot be changed, even when the array handle is used as an output.
There was a mistake where the PrepareFor* methods tried to make
the offsets mutable. In the case of an output, the offsets were not
pushed to the execution environment, and the arrays could not be looked
up.
This commit is contained in:
Kenneth Moreland 2017-02-22 15:44:06 -07:00
parent 6d9766943e
commit 81f7ff2391
2 changed files with 3 additions and 4 deletions

@ -305,7 +305,7 @@ public:
using PortalExecution =
vtkm::exec::internal::ArrayPortalGroupVecVariable<
typename SourceArrayHandleType::template ExecutionTypes<Device>::Portal,
typename OffsetsArrayHandleType::template ExecutionTypes<Device>::Portal>;
typename OffsetsArrayHandleType::template ExecutionTypes<Device>::PortalConst>;
using PortalConstExecution =
vtkm::exec::internal::ArrayPortalGroupVecVariable<
typename SourceArrayHandleType::template ExecutionTypes<Device>::PortalConst,
@ -334,7 +334,7 @@ public:
PortalExecution PrepareForInPlace(bool vtkmNotUsed(updateData))
{
return PortalExecution(this->SourceArray.PrepareForInPlace(Device()),
this->OffsetsArray.PrepareForInPlace(Device()));
this->OffsetsArray.PrepareForInput(Device()));
}
VTKM_CONT
@ -344,8 +344,7 @@ public:
VTKM_ASSERT(numberOfValues == this->OffsetsArray.GetNumberOfValues());
return PortalExecution(this->SourceArray.PrepareForOutput(
this->SourceArray.GetNumberOfValues(), Device()),
this->OffsetsArray.PrepareForOutput(
numberOfValues, Device()));
this->OffsetsArray.PrepareForInput(Device()));
}
VTKM_CONT

0
vtkm/cont/StorageBasic.h Executable file → Normal file