Quantcast
Channel: Intel® Fortran Compiler for Linux* and macOS*
Viewing all articles
Browse latest Browse all 2583

how to check if the array is aligned at 64 byte

$
0
0
I use the directive to align the array at 64 byte, and I want to check whether this works. The following code is my try. However, it is likely that the alignment directive doesn't work because the mod result isn't zero.
program aligntest
       integer ,dimension(9) :: a
       integer ,dimension(9) :: b
       !dir$ attributes align: 64 :: a,b

       a=0
       b=1
       !use the address mod 64*8=512
       print *,mod(loc(a),512)
       print *,mod(loc(b),512)
 end program aligntest

 


Viewing all articles
Browse latest Browse all 2583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>