Skip to content

Correct the implementation of DeviceAdapterAlgorithmGeneral::Unique

Kenneth Moreland requested to merge kmorel/vtk-m:correct-simple-unique into master

The implementation of the simplified version of DeviceAdapterAlgorithmGeneral::Unique had two errors.

First, the implementation is such that it calls the more complex version of Unique (which specifies a binary predicate to establish equality). However, it was not calling the Unique method in the DerivedAlgorithm like it should have been. Instead, it was calling its own Unique algorithm, which might not be as efficient as the specialized Unique for the device.

Second, it was using std::equal_to as its binary predicate. Using functors from std can be dangerous because they are not marked with VTKM_EXEC, so have the potential to not work in the execution environment. Instead, use the readily available vtkm::Equal binary predicate.

Merge request reports

Loading