[英]Non-POD datatypes allowed in firstprivate of OpenMP parallel section?
Can we specify a std::vector object in the firstprivate clause of a openmp task pragma? 我们可以在openmp任务编译指示的firstprivate子句中指定std :: vector对象吗?
Is is possible to make a vector object firstprivate? 可以使向量对象成为第一个私有对象吗?
It compiles and runs correctly... It is always threadsafe? 它可以编译并正确运行...它始终是线程安全的吗?
Yes you can 是的你可以
So basically as long as 所以基本上只要
Note that the STL containers satisfy these criteria but you may alter the semantics by doing a container of (non-shared) pointer elements, etc. 请注意 ,STL容器满足这些条件,但是您可以通过对(非共享的)指针元素进行容器化等来更改语义。
You're good to go 你很好去
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.