在c/c++?中包含的stdio.h中包含OpenMP。
我搜索了OpenMP,并意识到有些人包括OMP.H,而其他人则没有。他们只是包括stdio.h。
因此,我的问题是:stdio.h中是否包含OpenMP,以便在仅包括它的情况下可以使用OPEMP?
我认为旧的OpenMP(例如OpenMP2.0)需要与OPM.H一起使用,但是OpenMP3.0不需要这样。 但是我不确定...
I searched about openmp, and realised that some people includes omp.h and others do not. They just include stdio.h.
So my question is: Is openmp included in stdio.h so that we can use opemp if we only include it?
I think old openmp such as openmp2.0 need to be used with omp.h but openmp3.0 does not need to be so.
but I'm not sure...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
stdio.h
不包含omp.h
。您的困惑可能是因为使用
#pragma Omp ...
指令您不必包括omp.h
,因此这意味着您可以在不包括OpenMP程序的情况下编写OpenMP程序opm.h
。另一方面,如果您使用任何OpenMP Runtime库函数(例如
OMP_GET_NUM_THREADS()
),您必须包括opm.h
,无论OpenMP版本如何。stdio.h
does not containomp.h
.Your confusion may be because to use
#pragma omp ...
directives you do not have to includeomp.h
, so it means that you can write an OpenMP program without includingomp.h
.On the other hand, if you use any OpenMP runtime library function (e.g.
omp_get_num_threads()
) you have to includeomp.h
regardless of the version of OpenMP.