gpt4 book ai didi

c++ - omp_set_max_active_levels() 和函数调用

转载 作者:太空狗 更新时间:2023-10-29 23:17:22 24 4
gpt4 key购买 nike

任何人都知道 omp_set_max_active_levels() 的范围,假设函数 A 有一个 omp 并行区域,并且在该区域中,A 的每个线程调用库函数 B,在库函数 B 中有 2 个级别的 omp 并行性。

那么,如果我们将函数A中的active omp level设置为3(A中为1,B中为2),是否可以保证库函数B的并行区域正常工作?

最佳答案

如果从事件并行区域内调用 omp_set_max_active_levels(),则将(应该)忽略该调用。

关于c++ - omp_set_max_active_levels() 和函数调用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18435425/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com