jeudi 14 février 2019

How to fix 'User Error 1001: argument to num_threads clause must be positive' in using '#pragma omp parallel for'?

I am using OpenMP by simple #pragma omp parallel for before the for loop I need, but there is an error showed up “User Error 1001: argument to num_threads clause must be positive" when I choose the debug mode but no error in release mode. I found I have to set the thread numbers like:

pcl::NormalEstimationOMP<PointNT, PointNT> nest;

nest.setNumberOfThreads(4); 

But I don't know how to set it if I just use #pragma omp parallel for

#pragma omp parallel for
    for (int idx = 0; idx < srcImgVec.size(); ++idx)
    {
        enhanceContrast(srcImgVec.at(idx), hsirAcquPara);
    }

Aucun commentaire:

Enregistrer un commentaire