mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-19 18:45:43 +00:00
Merge topic 'safer_vectorizations_for_serial_backend'
73b90a2e Don't provide vectorization hints for operations that can be done inplace. Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !360
This commit is contained in:
commit
57471721f7
@ -225,12 +225,8 @@ public:
|
|||||||
//The ICC compiler has been found to improperly optimize the copy_backwards
|
//The ICC compiler has been found to improperly optimize the copy_backwards
|
||||||
//into a standard copy, causing the above issue.
|
//into a standard copy, causing the above issue.
|
||||||
T lastValue = inputPortal.Get(numberOfValues - 1);
|
T lastValue = inputPortal.Get(numberOfValues - 1);
|
||||||
|
|
||||||
VTKM_VECTORIZATION_PRE_LOOP
|
|
||||||
for(vtkm::Id i=(numberOfValues-1); i >= 1; --i)
|
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(i, inputPortal.Get(i-1));
|
||||||
}
|
}
|
||||||
outputPortal.Set(0, initialValue);
|
outputPortal.Set(0, initialValue);
|
||||||
@ -358,10 +354,8 @@ private:
|
|||||||
PortalI indexPortal = index.PrepareForInput(Device());
|
PortalI indexPortal = index.PrepareForInput(Device());
|
||||||
PortalVout valuesOutPortal = values_out.PrepareForOutput(n, Device());
|
PortalVout valuesOutPortal = values_out.PrepareForOutput(n, Device());
|
||||||
|
|
||||||
VTKM_VECTORIZATION_PRE_LOOP
|
|
||||||
for (vtkm::Id i=0; i<n; i++)
|
for (vtkm::Id i=0; i<n; i++)
|
||||||
{
|
{
|
||||||
VTKM_VECTORIZATION_IN_LOOP
|
|
||||||
valuesOutPortal.Set( i, valuesPortal.Get(indexPortal.Get(i)) );
|
valuesOutPortal.Set( i, valuesPortal.Get(indexPortal.Get(i)) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user