Go to the documentation of this file.
11 #ifndef vtk_m_UpperBound_h
12 #define vtk_m_UpperBound_h
17 #include <vtkm/internal/Configure.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
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_EXEC_CONT vtkm::cont::ArrayPortalToIterators< PortalType >::IteratorType ArrayPortalToIteratorBegin(const PortalType &portal)
Convenience function for converting an ArrayPortal to a begin iterator.
Definition: ArrayPortalToIterators.h:178
Groups connected points that have the same field value.
Definition: Atomic.h:19
VTKM_EXEC_CONT 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
#define VTKM_EXEC_CONT
Definition: ExportMacros.h:52
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_EXEC_CONT vtkm::cont::ArrayPortalToIterators< PortalType >::IteratorType ArrayPortalToIteratorEnd(const PortalType &portal)
Convenience function for converting an ArrayPortal to an end iterator.
Definition: ArrayPortalToIterators.h:189
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
Binary Predicate that takes two arguments argument x, and y and returns True if and only if x is less...
Definition: BinaryPredicates.h:45