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

Dynamical allocation of SSE-aligned memory

Tags: None
(comma "," separated)
rwerp
Registered Member
Posts
4
Karma
0
OS
I want to use Map<MatrixXcd> to work on dynamically allocated memory. How can I allocate the memory under Visual Studio C++ so that it's aligned correctly and I can pass the Aligned flag to Map<MatrixXcd>?
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
you could use our aligned_malloc/aligned_free internal routines (from internal namespace)
katastrofa
Registered Member
Posts
5
Karma
0
Great, thanks.
rwerp
Registered Member
Posts
4
Karma
0
OS
Another question: I have used "aligned_new<T>" and "aligned_delete<T>" to obtain what I want, but then when I create a standard Eigen::VectorXcd object, my program throws a heap corruption error (I'm using MS Visual Studio C++ 2010). Does it mean I can't mix "aligned_new" and standard Eigen routines?

-- EDIT --

This problem also occurs when I use aligned_malloc/aligned_free.
katastrofa
Registered Member
Posts
5
Karma
0
Sorry, the problem was caused by an unrelated error in my code (writing past the end of allocated memory).

Thanks for the advice, the code works and is faster now.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]