<div dir="ltr">Hi,<div><br></div><div style>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 ).</div><div style>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.</div>
<div style>Apparently this results in non-optimal code in particular in a function call and bad performance when I copy/assign a lot of Vectors.</div><div style><br></div><div style>My workaround of looping over the individual vectors in the Vc::memory resolves this problem but is of course ugly.</div>
<div style><br></div><div style>Did someone see a similar issue?</div><div><br><div><br></div><div>class Vector3D </div><div>{</div><div><br></div><div>private:</div><div><br></div><div> Vc::Memory<Vc::Vector<double>, 3> mem;</div>
<div><br></div><div>public:</div><div>// ...</div><div> Vector3D & operator=( Vector3D const & rhs )</div><div> {</div><div><br></div><div> for( int i=0; i < 1 + 3/Vc::Vector<double>::Size; i++ )</div>
<div> {</div><div> Vc::Vector<double> v1 = rhs.mem.vector(i);</div><div> this->mem.vector(i)=v1;</div><div> }</div><div> // the following line must not be used: this is a bug in Vc </div>
<div> // this->mem = rhs.mem; </div><div> return *this;</div><div> }</div>
<div>}</div><div><br></div>-- <br><div dir="ltr">Dr. Sandro Wenzel<br><div>PH / SFT</div><div>CERN <br><br></div></div></div></div>