- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there any way by which we can direct the compiler to align memory while allocating memory statically or dynamically ??
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have a look at the documentation of the -align option.
These sites might be useful to you as well:
http://software.intel.com/sites/products/documentation/hpc/ipp/ia32/ippugch7/Memory_Alignment.htm
http://software.intel.com/en-us/articles/performance-tools-for-software-developers-memory-function-faq/
This topic might also be of interest:
http://software.intel.com/en-us/forums/showthread.php?t=73470
These sites might be useful to you as well:
http://software.intel.com/sites/products/documentation/hpc/ipp/ia32/ippugch7/Memory_Alignment.htm
http://software.intel.com/en-us/articles/performance-tools-for-software-developers-memory-function-faq/
This topic might also be of interest:
http://software.intel.com/en-us/forums/showthread.php?t=73470
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For static allocation use __declspec(aligned(n)) where n is required alignment (16, 64, 128 bytes).
For dynamic allocation use functions such as _mm_malloc() and _mm_free() (they are defined with SIMD intrinsics).
For dynamic allocation in C++ code (i.e. when allocating objects of some class which have a member that shoudl be aligned) you need to override new and delete operators using placement new and delete.
For dynamic allocation use functions such as _mm_malloc() and _mm_free() (they are defined with SIMD intrinsics).
For dynamic allocation in C++ code (i.e. when allocating objects of some class which have a member that shoudl be aligned) you need to override new and delete operators using placement new and delete.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page