Quantcast
Channel: Intel® Fortran Compiler
Viewing all articles
Browse latest Browse all 3270

!$OMP SIMD or !DIR$ SIMD ?

$
0
0

Hi,

I have two quick questions regarding using SIMD directives.

(1) I am currently using !DIR$ SIMD to help the compiler to vectorize the loops. But I just noticed that in OpenMP 4.0 we have the following directives:

!$OMP SIMD

!$OMP END SIMD

I am a little bit confused about why we need !$OMP SIMD since !DIR$ SIMD works for both non-openmp code and openmp code. !$OMP SIMD only works when I add the compiler option -openmp to generate openmp code, right?

(2) What about the portability of the SIMD directives (!DIR$ SIMD or !$OMP SIMD)? Later I may test my code on different platforms with different compilers. I guess !DIR$ SIMD only works with Intel compiler while !$OMP SIMD may be supported by more vendors.

Thanks for your time and help!

Best regards,

   Wentao


Viewing all articles
Browse latest Browse all 3270


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