- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How can I ALLOCATE an array so that it aligned with a 32-byte boundary? I need to do this for optimum performance when calling Intel's vectorized math libraries...
thanks!
thanks!
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can't specify alignment with ALLOCATE. Best I can recommend is to malloc n+32 bytes, add 31 to the base address and then AND off the low five bits. Assign this to an integer POINTER for your array pointer. Don't forget to save the original allocated address for the free/
Steve
Steve
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