Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 OpenMP 中将静态变量和函数(来自模板化类)设为私有,以便在每个线程中具有不同的值?
根据场景,您应该能够使用:
#pragma omp threadprivate(theVariable)
有关详细信息,请参阅这篇关于在 OpenMP 中使用线程本地存储的文章。