potential problem in Vc::Memory
Sandro Wenzel
[please enable javascript to see the address]
Thu Jun 5 10:24:39 CEST 2014
Hi,
I have observed a strange problem with Vc::Memory which I am using in a
little cartesian vector class like below ( branch Vc 0.8, gcc >= 4.7 ).
The problem was observed in the copy or assignment operator of this class.
To copy the internal data I tried the operator= of Vc::memory.
Apparently this results in non-optimal code in particular in a function
call and bad performance when I copy/assign a lot of Vectors.
My workaround of looping over the individual vectors in the Vc::memory
resolves this problem but is of course ugly.
Did someone see a similar issue?
class Vector3D
{
private:
Vc::Memory<Vc::Vector<double>, 3> mem;
public:
// ...
Vector3D & operator=( Vector3D const & rhs )
{
for( int i=0; i < 1 + 3/Vc::Vector<double>::Size; i++ )
{
Vc::Vector<double> v1 = rhs.mem.vector(i);
this->mem.vector(i)=v1;
}
// the following line must not be used: this is a bug in Vc
// this->mem = rhs.mem;
return *this;
}
}
--
Dr. Sandro Wenzel
PH / SFT
CERN
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://compeng.uni-frankfurt.de/pipermail/vc/attachments/20140605/6d3205db/attachment.html>
More information about the Vc
mailing list