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

Vectorization and Visual C 2010?

Tags: None
(comma "," separated)
vfreak
Registered Member
Posts
5
Karma
0
OS

Vectorization and Visual C 2010?

Tue Mar 22, 2011 2:54 pm
Hi.

I'm an Eigen newbie using Eigen to handle some 3d transforms in an OpenGL application I writing.

I'm using Visual Studio 2010, and have had lots of problems with the
dreaded misaligned array assert.

I can fix class member alignment with #pragma pack() (or the constructor
macro), but as far as I can tell there is no way to correct or enforce
stack alignment.

Without that, simple things like 'Quaternion<float>::Identity()' will
assert because the stack-allocated array is misaligned.

In the end I gave up and disabled vectorization.

But I'm curious to know if I'm missing something, and whether it IS
possible to enable vectorisation under this platform?

Thanks in advance.

Ross.
User avatar
bjacob
Registered Member
Posts
658
Karma
3
Have you read the page linked to from the assertion message?
http://eigen.tuxfamily.org/dox/TopicUna ... ssert.html


Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list!
vfreak
Registered Member
Posts
5
Karma
0
OS
Yep. And I understand the issue. What I perhaps missed was the scope of the
problem.

I didn't realise that there was no way to guarantee stack alignment of
objects in C++. This means you have to avoid all static methods that
return objects (I know - effectively passing by value). In my case Quaternion::Identity().

Maybe the web-page could mention that someplace to help us newbs?

Thanks.

Ross.


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], q.ignora