Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Todor_K_
Beginner
55 Views

ALLOCATE or MKL_MALLOC?

In Fortran, assuming I have a 64bit avx-able machine at my disposal, Is ALLOCATE statement guaranteed to allocate aligned arrays when the compiler is called with the "-align array64byte" flag? Or, do I need to call MKL_MALLOC in order to achieve this? I would really like to avoid  MKL_MALLOC if possible, because, according to the example from the MKL 11 reference, it uses Cray pointers. My entire program is Fortran 2008, I'd hate to pollute it with such things.

Additionally, If there are no guarantees, is there a way to check if the allocation is aligned without resorting to an external C function which calculates the modulo?


 

0 Kudos
1 Reply
Zhang_Z_Intel
Employee
55 Views

"-align array64byte" compiler flag should give you what you need. See more details about aligning arrays in FORTRAN in this article:

https://software.intel.com/en-us/articles/fortran-array-data-and-arguments-and-vectorization

 

Reply