Если я создаю несколько gpu :: DeviceArrays в pcl, только первое создание DeviceArray занимает время (~ 80 мс).Создание последующих массивов устройств занимает ноль мс времени.Это ожидаемое поведение.Чем это объясняется?
Мой код и время указаны ниже:
#include <pcl/gpu/octree/octree.hpp>
#include <pcl/gpu/containers/device_array.hpp>
#include <pcl/point_types.h>
#include <pcl/common/time.h>
int main (int argc, char** argv)
{
pcl::StopWatch sw;
sw.reset();
pcl::gpu::DeviceArray<pcl::PointXYZ> cloud_device;
cloud_device.create(640*480);
std::cout<<"time taken to create cloud device array="<<sw.getTime() << std::endl;
sw.reset();
// create the gpu normals class
pcl::gpu::NormalEstimation::Normals normals_device;
normals_device.create(640*480);
std::cout<<"time taken to create normals device array="<<sw.getTime() << std::endl;
sw.reset();
pcl::gpu::Octree::PointCloud cloud_octree_device;
cloud_octree_device.create(640*480);
std::cout<<"time taken to create octree device array="<<sw.getTime() << std::endl;
return 0;
}
Output:
time taken to create cloud device array=80
time taken to create normals device array=0
time taken to create octree device array=0