From 73b90a2e4404f348ae8b69180e47a3909abd777f Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Tue, 15 Mar 2016 16:15:11 -0400 Subject: [PATCH] Don't provide vectorization hints for operations that can be done inplace. Previously we hinted to the compiler that it should vectorized operations where the input and output are the same array. This obviously caused problems, and these hints had to be removed. In the future we need to first check for aliased arrays, and go from there. --- vtkm/cont/internal/DeviceAdapterAlgorithmSerial.h | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/vtkm/cont/internal/DeviceAdapterAlgorithmSerial.h b/vtkm/cont/internal/DeviceAdapterAlgorithmSerial.h index f5ff5e905..ad511e7e1 100644 --- a/vtkm/cont/internal/DeviceAdapterAlgorithmSerial.h +++ b/vtkm/cont/internal/DeviceAdapterAlgorithmSerial.h @@ -225,14 +225,10 @@ public: //The ICC compiler has been found to improperly optimize the copy_backwards //into a standard copy, causing the above issue. T lastValue = inputPortal.Get(numberOfValues - 1); - -VTKM_VECTORIZATION_PRE_LOOP for(vtkm::Id i=(numberOfValues-1); i >= 1; --i) - { - //nothing for gcc as input & output could be the same -VTKM_VECTORIZATION_IN_LOOP + { outputPortal.Set(i, inputPortal.Get(i-1)); - } + } outputPortal.Set(0, initialValue); std::partial_sum(vtkm::cont::ArrayPortalToIteratorBegin(outputPortal), @@ -358,11 +354,9 @@ private: PortalI indexPortal = index.PrepareForInput(Device()); PortalVout valuesOutPortal = values_out.PrepareForOutput(n, Device()); -VTKM_VECTORIZATION_PRE_LOOP for (vtkm::Id i=0; i