Reputation: 87
Can we specify a std::vector object in the firstprivate clause of a openmp task pragma?
Is is possible to make a vector object firstprivate?
It compiles and runs correctly... It is always threadsafe?
Upvotes: 0
Views: 170
Reputation: 393467
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.
You're good to go
Upvotes: 1