Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.

ALLOCATE or MKL_MALLOC?

Todor_K_
Novice
152 Views

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
152 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