Go to the documentation of this file.
11 #ifndef vtk_m_UpperBound_h
12 #define vtk_m_UpperBound_h
29 template <
typename IterT,
typename T,
typename Comp>
32 #if defined(VTKM_CUDA) || defined(VTKM_HIP)
33 auto len = last - first;
36 const auto halfLen = len / 2;
37 IterT mid = first + halfLen;
49 #else // VTKM_CUDA || VTKM_HIP
50 return std::upper_bound(first, last, val, std::move(comp));
51 #endif // VTKM_CUDA || VTKM_HIP
54 template <
typename IterT,
typename T>
60 template <
typename PortalT,
typename T,
typename Comp>
66 return static_cast<vtkm::Id>(result - first);
69 template <
typename PortalT,
typename T>
75 return static_cast<vtkm::Id>(result - first);
81 #endif // vtk_m_UpperBound_h
IterT UpperBound(IterT first, IterT last, const T &val, Comp comp)
Implementation of std::upper_bound that is appropriate for both control and execution environments.
Definition: UpperBound.h:30
Groups connected points that have the same field value.
Definition: Atomic.h:19
#define VTKM_EXEC_CONT
Definition: ExportMacros.h:52
vtkm::cont::ArrayPortalToIterators< PortalType >::IteratorType ArrayPortalToIteratorEnd(const PortalType &portal)
Convenience function for converting an ArrayPortal to an end iterator.
Definition: ArrayPortalToIterators.h:189
Binary Predicate that takes two arguments argument x, and y and returns True if and only if x is less...
Definition: BinaryPredicates.h:45
vtkm::Int64 Id
Base type to use to index arrays.
Definition: Types.h:227
vtkm::cont::ArrayPortalToIterators< PortalType >::IteratorType ArrayPortalToIteratorBegin(const PortalType &portal)
Convenience function for converting an ArrayPortal to a begin iterator.
Definition: ArrayPortalToIterators.h:178