在c/c++?中包含的stdio.h中包含OpenMP。

发布于 2025-02-08 11:33:19 字数 184 浏览 1 评论 0原文

我搜索了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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

静谧 2025-02-15 11:33:19

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 contain omp.h.

Your confusion may be because to use #pragma omp ... directives you do not have to include omp.h, so it means that you can write an OpenMP program without including omp.h.

On the other hand, if you use any OpenMP runtime library function (e.g. omp_get_num_threads()) you have to include omp.h regardless of the version of OpenMP.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文