Home > Back-end >  Solving the openmp dynamic library, the main program calls will collapse
Solving the openmp dynamic library, the main program calls will collapse

Time:09-21

Vs2013 encountered in the development of dynamic library, have a class of dynamic link library, member functions use openmp, engineering used in the class there are two ways, one is through the function of new class - this class, the derived class address to call again, another is by direct new base class call interface, the former call directly to collapse, which run OK, always can't find the reason
Only use openmp to collapse in a class member function, the following code will not collapse

Extern "C" DllExport void test ()
{
WORD bFindAFileHead=0;
# pragma omp parallel for
For (long I=0; I & lt; 1000000; + + I)
{
BFindAFileHead++;
}

# pragma omp barrier
}

Model code address http://pan.baidu.com/s/1nvr0021
Everyone a great god interested can look at
  • Related