MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / upper_bound

Function upper_bound

tensorflow/core/util/gpu_kernel_helper.h:285–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

283namespace gpu_helper {
284template <typename T, typename OutType = int32>
285__device__ OutType upper_bound(const T* first, OutType count, T val) {
286 const T* orig = first;
287 const T* it = nullptr;
288 OutType step = 0;
289 while (count > 0) {
290 it = first;
291 step = count / 2;
292 it += step;
293 if (!(val < *it)) {
294 first = ++it;
295 count -= step + 1;
296 } else {
297 count = step;
298 }
299 }
300
301 return first - orig;
302}
303
304template <typename T, typename OutType = int32>
305__device__ OutType lower_bound(const T* first, OutType count, T val) {

Callers 15

CalculateBucketIndexMethod · 0.85
FindMemoryRegionMethod · 0.85
InsertMemoryRegionMethod · 0.85
EvictMemoryRegionMethod · 0.85
FindMemoryRegionMethod · 0.85
InsertMemoryRegionMethod · 0.85
EvictMemoryRegionMethod · 0.85
AddAllocationRegionMethod · 0.85
RegionForMethod · 0.85
AddMethod · 0.85
ComputeMethod · 0.85
ComputeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected