版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/lch_vison/article/details/80806454
在应用OpenMP,可能会报错“User Error 1001: argument to num_threads clause must be positive”。这是由于设置的线程数必须为正,而程序中可能没有设置,有时候甚至环境变量中设置了,但是依然报错,我们不妨手动设置一下,例如对于PCL中的一段程序:
pcl::NormalEstimationOMP<PointNT, PointNT> nest;
nest.setNumberOfThreads(4); // 手动设置线程数,比源码增加,否则提示错误
nest.setRadiusSearch(0.01);
nest.setInputCloud(scene);
nest.compute(*scene);
Enjoy!