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

Use of a memory manager with Eigen

Tags: None
(comma "," separated)
dwilliamsyoung
Registered Member
Posts
1
Karma
0

Use of a memory manager with Eigen

Sat Apr 11, 2015 3:58 pm
Is there any way to tell Eigen where to allocate memory during Dynamic allocation? My current code structure involves allocating a large amount of memory at the beginning of the program and carving pieces out when ever I allocate memory in the program. Is it possible to integrate Eigen into the structure?

Thanks!
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
There is no easy solution for that yet. An ugly workaround would consists in adding overloads of the following template functions:
Code: Select all
template<typename T, bool Align> EIGEN_DEVICE_FUNC inline T* conditional_aligned_new_auto(size_t size);
template<typename T, bool Align> inline T* conditional_aligned_realloc_new_auto(T* pts, size_t new_size, size_t old_size);
template<typename T, bool Align> EIGEN_DEVICE_FUNC inline void conditional_aligned_delete_auto(T *ptr, size_t size);


See src/Core/utils/Memory.h file. You need to add overloads for each scalar type you need.


Bookmarks



Who is online

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