30 #ifndef HIBCUB_ROCPRIM_THREAD_THREAD_SEARCH_HPP_
31 #define HIBCUB_ROCPRIM_THREAD_THREAD_SEARCH_HPP_
35 BEGIN_HIPCUB_NAMESPACE
37 #ifndef DOXYGEN_SHOULD_SKIP_THIS
48 __host__ __device__ __forceinline__
void MergePathSearch(
54 CoordinateT& path_coordinate)
56 OffsetT split_min = CUB_MAX(diagonal - b_len, 0);
57 OffsetT split_max = CUB_MIN(diagonal, a_len);
59 while (split_min < split_max)
61 OffsetT split_pivot = (split_min + split_max) >> 1;
62 if (a[split_pivot] <= b[diagonal - split_pivot - 1])
65 split_min = split_pivot + 1;
70 split_max = split_pivot;
74 path_coordinate.x = CUB_MIN(split_min, a_len);
75 path_coordinate.y = diagonal - split_min;
84 typename InputIteratorT,
87 __device__ __forceinline__ OffsetT LowerBound(
95 OffsetT half = num_items >> 1;
96 if (input[retval + half] < val)
98 retval = retval + (half + 1);
99 num_items = num_items - (half + 1);
115 typename InputIteratorT,
118 __device__ __forceinline__ OffsetT UpperBound(
119 InputIteratorT input,
124 while (num_items > 0)
126 OffsetT half = num_items >> 1;
127 if (val < input[retval + half])
133 retval = retval + (half + 1);
134 num_items = num_items - (half + 1);