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__ constexpr __device__ RandomIt binary_find (RandomIt first, RandomIt last, const T &value, Compare comp={})
 
template<typename RandomIt , typename T , typename Compare = less<T>>
__host__ constexpr __device__ RandomIt lower_bound (RandomIt first, RandomIt last, const T &value, Compare comp={})
 
template<typename RandomIt , typename T , typename Compare = less<T>>
__host__ constexpr __device__ 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__ constexpr __device__ RandomIt cuda_std::binary_find ( RandomIt  first,
RandomIt  last,
const T value,
Compare  comp = {} 
)
constexpr

Definition at line 63 of file cudastdAlgorithm.h.

63  {}) {
65  return first != last && !comp(value, *first) ? first : last;
66  }

◆ lower_bound()

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

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  }

◆ upper_bound()

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

Definition at line 45 of file cudastdAlgorithm.h.

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  }

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

step
step
Definition: StallMonitor.cc:94
dqmdumpme.first
first
Definition: dqmdumpme.py:55
AlCaHLTBitMon_QueryRunRegistry.comp
comp
Definition: AlCaHLTBitMon_QueryRunRegistry.py:249
dqmdumpme.last
last
Definition: dqmdumpme.py:56
submitPVResolutionJobs.count
count
Definition: submitPVResolutionJobs.py:352
cuda_std::lower_bound
__host__ constexpr __device__ RandomIt lower_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
Definition: cudastdAlgorithm.h:27
value
Definition: value.py:1