TEST(PCL_OctreeGPU, DISABLED_performance)
| 70 | |
| 71 | //TEST(PCL_OctreeGPU, DISABLED_performance) |
| 72 | TEST(PCL_OctreeGPU, performance) |
| 73 | { |
| 74 | DataGenerator data; |
| 75 | data.data_size = 871000; |
| 76 | data.tests_num = 10000; |
| 77 | data.cube_size = 1024.f; |
| 78 | data.max_radius = data.cube_size/15.f; |
| 79 | data.shared_radius = data.cube_size/15.f; |
| 80 | data.printParams(); |
| 81 | |
| 82 | //const int k = 32; |
| 83 | |
| 84 | std::cout << "sizeof(pcl::gpu::Octree::PointType): " << sizeof(pcl::gpu::Octree::PointType) << std::endl; |
| 85 | //std::cout << "k = " << k << std::endl; |
| 86 | //generate data |
| 87 | data(); |
| 88 | |
| 89 | //prepare device cloud |
| 90 | pcl::gpu::Octree::PointCloud cloud_device; |
| 91 | cloud_device.upload(data.points); |
| 92 | |
| 93 | //prepare queries_device |
| 94 | pcl::gpu::Octree::Queries queries_device; |
| 95 | pcl::gpu::Octree::Radiuses radiuses_device; |
| 96 | queries_device.upload(data.queries); |
| 97 | radiuses_device.upload(data.radiuses); |
| 98 | |
| 99 | //prepare host cloud |
| 100 | pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_host(new pcl::PointCloud<pcl::PointXYZ>); |
| 101 | cloud_host->width = data.points.size(); |
| 102 | cloud_host->height = 1; |
| 103 | cloud_host->resize (cloud_host->width * cloud_host->height); |
| 104 | std::transform(data.points.cbegin(), data.points.cend(), cloud_host->begin(), DataGenerator::ConvPoint<pcl::PointXYZ>()); |
| 105 | |
| 106 | float host_octree_resolution = 25.f; |
| 107 | |
| 108 | std::cout << "[!] Host octree resolution: " << host_octree_resolution << std::endl << std::endl; |
| 109 | |
| 110 | std::cout << "====== Build performance =====" << std::endl; |
| 111 | // build device octree |
| 112 | pcl::gpu::Octree octree_device; |
| 113 | octree_device.setCloud(cloud_device); |
| 114 | { |
| 115 | ScopeTime up("gpu-build"); |
| 116 | octree_device.build(); |
| 117 | } |
| 118 | { |
| 119 | ScopeTime up("gpu-download"); |
| 120 | octree_device.internalDownload(); |
| 121 | } |
| 122 | |
| 123 | //build host octree |
| 124 | pcl::octree::OctreePointCloudSearch<pcl::PointXYZ> octree_host(host_octree_resolution); |
| 125 | octree_host.setInputCloud (cloud_host); |
| 126 | { |
| 127 | ScopeTime t("host-build"); |
| 128 | octree_host.addPointsFromInputCloud(); |
| 129 | } |
nothing calls this directly
no test coverage detected