Re: [eigen] help speeding up an expression?

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


What about z*z*z + z*z = z*z*(z+1)?

Marton

On 2 Aug 2013 23:26, "Dick Lyon" <dicklyon@xxxxxxxxxx> wrote:
Has anyone got tips on how to speed up this eigen code that is the slowest part of my process?

Simplified, I have this in an inline function definition with argument ArrayXf& z:

  z += 0.175;
  z = (z < 0).select(0.0, (z*z*z) / (z*z*z + z*z + 0.1));

Can this be sped up by clever use of pre-allocated temp arrays?  Or is eigen already more clever than anything I'd likely come up with?  And how can I tell, or where should I look to learn more about how to think about optimizing such things?

Is select fast?  Or are there better ways to threshold things?

I'm on an Intel platform, but ultimately also targeting Arm NEON, in case that matters.

Dick



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/