Issue with OpenMP reduction on std::vector passed by reference
问题 There is a bug in intel compiler on user-defined reduction in OpenMP which was discussed here (including the wrokaround). Now I want to pass the vector to a function and do the same thing but I get this error: terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc Aborted This is the example: #include <iostream> #include <vector> #include <algorithm> #include "omp.h" #pragma omp declare reduction(vec_double_plus : std::vector<double> : \ std::transform(omp_out