This forum has been archived. All content is frozen. Please use KDE Discuss instead.

vectorization for Vector3d?

Tags: None
(comma "," separated)
eudoxos
Registered Member
Posts
36
Karma
0

vectorization for Vector3d?

Sat Feb 21, 2009 3:16 pm
Hello,

I am new to eigen2 and I am considering switch away from Wildmagic3 library to eigen2 for 3d geometry in material modeling package, where speed is high priority (http://yade.wikia.com). We mostly need Vector3's (sums, dot, cross) and Quaternion's (rotation composition, conjugate, product with vector, axis-angle decomposition).

To justify the change among my fellows, I would like to use vectorization for Vector3 arithmetics, of which size is not a power of 2, thus not vectorized. What do you think about the tradeoffs when using Vector4 (which is vectorized), but ignore the last component?

Thanks for answers, and thanks for this very nice (seems to me now) piece of software.
User avatar
bjacob
Registered Member
Posts
658
Karma
3

RE: vectorization for Vector3d?

Sat Feb 21, 2009 3:29 pm
First of all, the criterion for vectorization for fixed sizes is not being a power of 2 bytes, it's being a multiple of 16 bytes. indeed, Vector3f and Vector3d can't be vectorized.

About your idea of using a vector of 4 components and ignoring the last ones: the first thing to say is that this is not always possible; only you can tell if in your case you can do that.

If you use doubles, i wouldn't expect a big benefit because even with vectorization you still have 2 packets. So it's probably not worth it.

If you use floats (Vector4f) then potentially you aim to 3x speed improvements, which is enough to let hope that even with the contortions you'll be doing, it might still be worth it.

Good luck... (i'm not optimistic to be honest)

Last edited by bjacob on Sat Feb 21, 2009 3:29 pm, edited 1 time in total.


Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list!
eudoxos
Registered Member
Posts
36
Karma
0

RE: vectorization for Vector3d?

Sat Feb 21, 2009 3:36 pm
Wow, this was _FAST_. Thank you.

I still think it would be worth the switch, since wm3 is not maintained (and it has a few bad design decisions, too, like absolute ZERO_TOLERANCE, which doesn't scale with the simulation size).

I had a quick look at wikipedia, and Intel is reportedly working on http://en.wikipedia.org/wiki/Advanced_Vector_Extensions , which will operate on 256-bit data. Until then (2011( no luck. Oh well.

Last edited by eudoxos on Sat Feb 21, 2009 3:37 pm, edited 1 time in total.


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot], rblackwell