diff --git a/gpu/features/src/centroid.cu b/gpu/features/src/centroid.cu index 045fe6f..3e9ef8b 100644 --- a/gpu/features/src/centroid.cu +++ b/gpu/features/src/centroid.cu @@ -44,7 +44,6 @@ #include "pcl/gpu/utils/device/vector_math.hpp" -using namespace thrust; namespace pcl { @@ -124,9 +123,10 @@ float3 pcl::device::getMaxDistance(const DeviceArray& cloud, const float thrust::counting_iterator ce = cf + cloud.size(); thrust::tuple init(0.f, 0); - thrust::maximum< tuple > op; + thrust::maximum> op; - tuple res = transform_reduce( + thrust::tuple res = + transform_reduce( make_zip_iterator(make_tuple( src_beg, cf )), make_zip_iterator(make_tuple( src_beg, ce )), TupleDistCvt(pivot), init, op); @@ -151,9 +151,9 @@ float3 pcl::device::getMaxDistance(const DeviceArray& cloud, const Indic thrust::counting_iterator ce = cf + indices.size(); thrust::tuple init(0.f, 0); - thrust::maximum< tuple > op; + thrust::maximum> op; - tuple res = transform_reduce( + thrust::tuple res = transform_reduce( make_zip_iterator(make_tuple( make_permutation_iterator(src_beg, map_beg), cf )), make_zip_iterator(make_tuple( make_permutation_iterator(src_beg, map_end), ce )), TupleDistCvt(pivot), init, op); diff --git a/gpu/octree/src/cuda/bfrs.cu b/gpu/octree/src/cuda/bfrs.cu index d392f67..0635e1e 100644 --- a/gpu/octree/src/cuda/bfrs.cu +++ b/gpu/octree/src/cuda/bfrs.cu @@ -43,7 +43,6 @@ #include "cuda.h" -using namespace thrust; namespace pcl { @@ -80,11 +79,11 @@ void pcl::device::bruteForceRadiusSearch(const OctreeImpl::PointCloud& cloud, co InSphere cond(query.x, query.y, query.z, radius); - device_ptr cloud_ptr((const PointType*)cloud.ptr()); - device_ptr res_ptr(buffer.ptr()); + thrust::device_ptr cloud_ptr((const PointType*)cloud.ptr()); + thrust::device_ptr res_ptr(buffer.ptr()); - counting_iterator first(0); - counting_iterator last = first + cloud.size(); + thrust::counting_iterator first(0); + thrust::counting_iterator last = first + cloud.size(); //main bottle neck is a kernel call overhead/allocs //work time for 871k points ~0.8ms diff --git a/gpu/octree/src/cuda/octree_builder.cu b/gpu/octree/src/cuda/octree_builder.cu index dfd2093..faad764 100644 --- a/gpu/octree/src/cuda/octree_builder.cu +++ b/gpu/octree/src/cuda/octree_builder.cu @@ -51,7 +51,6 @@ #include using namespace pcl::gpu; -using namespace thrust; namespace pcl { @@ -316,7 +315,7 @@ void pcl::device::OctreeImpl::build() // 3 * sizeof(int) => +1 row const int transaction_size = 128 / sizeof(int); - int cols = max(points_num, transaction_size * 4); + int cols = std::max(points_num, transaction_size * 4); int rows = 10 + 1; // = 13 storage.create(rows, cols); @@ -338,8 +337,8 @@ void pcl::device::OctreeImpl::build() { //ScopeTimer timer("reduce-morton-sort-permutations"); - device_ptr beg(points.ptr()); - device_ptr end = beg + points.size(); + thrust::device_ptr beg(points.ptr()); + thrust::device_ptr end = beg + points.size(); { PointType atmax, atmin; @@ -355,15 +354,15 @@ void pcl::device::OctreeImpl::build() octreeGlobal.maxp = make_float3(maxp.x, maxp.y, maxp.z); } - device_ptr codes_beg(codes.ptr()); - device_ptr codes_end = codes_beg + codes.size(); + thrust::device_ptr codes_beg(codes.ptr()); + thrust::device_ptr codes_end = codes_beg + codes.size(); { //ScopeTimer timer("morton"); thrust::transform(beg, end, codes_beg, CalcMorton(octreeGlobal.minp, octreeGlobal.maxp)); } - device_ptr indices_beg(indices.ptr()); - device_ptr indices_end = indices_beg + indices.size(); + thrust::device_ptr indices_beg(indices.ptr()); + thrust::device_ptr indices_end = indices_beg + indices.size(); { //ScopeTimer timer("sort"); thrust::sequence(indices_beg, indices_end); @@ -378,9 +377,9 @@ void pcl::device::OctreeImpl::build() } { - device_ptr xs(points_sorted.ptr(0)); - device_ptr ys(points_sorted.ptr(1)); - device_ptr zs(points_sorted.ptr(2)); + thrust::device_ptr xs(points_sorted.ptr(0)); + thrust::device_ptr ys(points_sorted.ptr(1)); + thrust::device_ptr zs(points_sorted.ptr(2)); //ScopeTimer timer("perm2"); thrust::transform(make_permutation_iterator(beg, indices_beg), make_permutation_iterator(end, indices_end),