开发者

Do I need to #include <omp.h> in my C/C++ sources?

Is it necessary to include omp.h in my C/C++ sources? Why? Or why not? Does the gcc compiler include it by default when used with the -fopenmp flag? It doesn't seem te 开发者_StackOverflow中文版make a differance.


You only need it to call OMP APIs. If all you need are pragmas you don't need to include it.


If you're using OpenMP functions in a given file, it is necessary for that file to include it. Otherwise it is not necessary.


The compiler flags (-openmp for Intel, -fopenmp for GCC) will not add it for you. If you need to use functions or types defined in this header, you will need to include it.


If you want to perform open multi processing (open multi processing is an application programming interface) This supports multi platform shared memory multi processing. If we want to do this then only it is necessary to include that header file in your code

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜