Skip to content

Replace deprecated VTK and thrust functions, fix other problems with thrust - #6460

Open
mvieth wants to merge 2 commits into
PointCloudLibrary:masterfrom
mvieth:replace_deprecated2
Open

Replace deprecated VTK and thrust functions, fix other problems with thrust#6460
mvieth wants to merge 2 commits into
PointCloudLibrary:masterfrom
mvieth:replace_deprecated2

Conversation

@mvieth

@mvieth mvieth commented Aug 9, 2026

Copy link
Copy Markdown
Member
  • Replace deprecated vtkTransformPolyDataFilter with vtkTransformFilter
  • Add thrust:: namespace to transform functions to resolve ambiguity
  • Replace deprecated thrust::maximum with cuda::maximum
  • Replace deprecated thrust:distance with cuda::std::distance
  • Replace deprecated Allocate with ReserveValues and Resize with ReserveTuples (VTK)

@mvieth
mvieth requested a balanced review from Copilot August 9, 2026 12:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.

Suppressed comments (3)

gpu/surface/src/cuda/convex_hull.cu:55

  • THRUST_VERSION and cuda::std::distance are used below, but the required headers are not included explicitly. Add <thrust/version.h> to guarantee THRUST_VERSION is defined, and include <cuda/std/iterator> (or equivalent) for cuda::std::distance to avoid relying on transitive includes.
#include <thrust/distance.h>
#include <thrust/tuple.h>
#include <thrust/iterator/counting_iterator.h>
#include <thrust/iterator/zip_iterator.h>
#include <thrust/transform_reduce.h>
#include <thrust/functional.h>
#include <thrust/sequence.h>
#include "thrust/device_ptr.h"
#include <thrust/transform.h>

visualization/src/point_cloud_handlers.cpp:625

  • This file now uses VTK_MAJOR_VERSION/VTK_MINOR_VERSION for conditional compilation, but it doesn't include <vtkVersion.h> anywhere in this translation unit. Relying on transitive includes for these macros is brittle and can break compilation when include order changes; include <vtkVersion.h> explicitly (typically in the includes section near the top of the file).
#if (VTK_MAJOR_VERSION > 9) || (VTK_MAJOR_VERSION == 9 && VTK_MINOR_VERSION >= 7)
  if (!data->ReserveTuples(nr_points))
#else
  if (!data->Resize(nr_points))
#endif

tools/virtual_scanner.cpp:247

  • This new VTK version guard uses VTK_MAJOR_VERSION/VTK_MINOR_VERSION, but the file does not include <vtkVersion.h>. To avoid compilation depending on transitive includes, add #include <vtkVersion.h> in the file's include list.
#if (VTK_MAJOR_VERSION < 9) || (VTK_MAJOR_VERSION == 9 && VTK_MINOR_VERSION < 7)
  // deprecated because it is a no-op, starting with VTK 9.7.0
  tree->SetTolerance (0.0);
#endif

@mvieth
mvieth force-pushed the replace_deprecated2 branch from 9a2bc23 to 0d3867e Compare August 9, 2026 12:19
@mvieth mvieth added module: gpu module: visualization skill: cuda Skills/areas of expertise needed to tackle the issue module: cuda and removed skill: cuda Skills/areas of expertise needed to tackle the issue labels Aug 10, 2026
@mvieth
mvieth marked this pull request as ready for review August 10, 2026 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants