CMS 3D CMS Logo

Classes | Functions
cuda_std Namespace Reference

Classes

struct  less
 
struct  less< void >
 

Functions

template<typename RandomIt , typename T , typename Compare = cuda_std::less<T>>
__host__ __device__ constexpr RandomIt binary_find (RandomIt first, RandomIt last, const T &value, Compare comp={})
 
template<typename RandomIt , typename T , typename Compare = less<T>>
__host__ __device__ constexpr RandomIt lower_bound (RandomIt first, RandomIt last, const T &value, Compare comp={})
 
template<typename RandomIt , typename T , typename Compare = less<T>>
__host__ __device__ constexpr RandomIt upper_bound (RandomIt first, RandomIt last, const T &value, Compare comp={})
 

Function Documentation

◆ binary_find()

template<typename RandomIt , typename T , typename Compare = cuda_std::less<T>>
__host__ __device__ constexpr RandomIt cuda_std::binary_find ( RandomIt  first,
RandomIt  last,
const T value,
Compare  comp = {} 
)

Definition at line 63 of file cudastdAlgorithm.h.

63  {}) {
65  return first != last && !comp(value, *first) ? first : last;
66  }
Definition: value.py:1
__host__ __device__ constexpr RandomIt lower_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})

◆ lower_bound()

template<typename RandomIt , typename T , typename Compare = less<T>>
__host__ __device__ constexpr RandomIt cuda_std::lower_bound ( RandomIt  first,
RandomIt  last,
const T value,
Compare  comp = {} 
)

Definition at line 27 of file cudastdAlgorithm.h.

27  {}) {
28  auto count = last - first;
29 
30  while (count > 0) {
31  auto it = first;
32  auto step = count / 2;
33  it += step;
34  if (comp(*it, value)) {
35  first = ++it;
36  count -= step + 1;
37  } else {
38  count = step;
39  }
40  }
41  return first;
42  }
Definition: value.py:1
step
Definition: StallMonitor.cc:98

◆ upper_bound()

template<typename RandomIt , typename T , typename Compare = less<T>>
__host__ __device__ constexpr RandomIt cuda_std::upper_bound ( RandomIt  first,
RandomIt  last,
const T value,
Compare  comp = {} 
)

Definition at line 45 of file cudastdAlgorithm.h.

Referenced by cms::cuda::for().

45  {}) {
46  auto count = last - first;
47 
48  while (count > 0) {
49  auto it = first;
50  auto step = count / 2;
51  it += step;
52  if (!comp(value, *it)) {
53  first = ++it;
54  count -= step + 1;
55  } else {
56  count = step;
57  }
58  }
59  return first;
60  }
Definition: value.py:1
step
Definition: StallMonitor.cc:98