Skip to main content
Ctrl+K
AMD Logo
ROCm™ Software 6.3.2 Version List
  • GitHub
  • Community
  • Blogs
  • Instinct™ Docs
  • Infinity Hub
  • Support

ROCm documentation

rocPRIM 3.3.0 Documentation

  • rocPRIM Concepts
    • Introduction to rocPRIM
    • Glossary
    • Performance tuning
    • Developer guidelines
  • API Reference
    • Summary of the Operations
    • Data type support
    • Device-Wide Operations
      • Configuring the Kernels
      • Transform
      • Unique
      • Sort
      • Partial Sort
      • Nth Element
      • Merge
      • Partition
      • Run Length Encode
      • Scan
      • Select
      • Reduce
      • Adjacent difference
      • Binary Search
      • Histogram
      • DeviceCopy
      • Memcpy
    • Block-Wide Operations
      • Operation classes
        • Load
        • Store
        • Adjacent difference
        • Discontinuity
        • Scan
        • Reduce
        • Shuffle
        • Exchange
        • Sort
        • Histogram
      • Data movement functions
    • Warp-Level Operations
      • Load
      • Store
      • Reduce
      • Scan
      • Sort
      • Shuffle
      • Exchange
    • Thread-Level Operations
      • Radix Key Encoder/Decoder
      • Operators
      • Load
      • Reduce
      • Scan
      • Search
      • Store
    • Iterators
    • Intrinsics
    • Utility types
    • Acknowledgements
  • License
  • rocPRIM...
  • Thread-Level...
  • Search...

Search

Contents

  • merge_path_search()
  • lower_bound()
  • upper_bound()
  • static_upper_bound()

Search#

group thread_search

Functions

template<class AIteratorT, class BIteratorT, class OffsetT, class CoordinateT, class BinaryFunction = rocprim::less<typename std::iterator_traits<AIteratorT>::value_type>>
__host__ __device__ inline void merge_path_search(OffsetT diagonal, AIteratorT a, BIteratorT b, OffsetT a_len, OffsetT b_len, CoordinateT &path_coordinate, BinaryFunction compare_function = BinaryFunction())#

Computes the begin offsets into A and B for the specific diagonal.

template<typename InputIteratorT, typename OffsetT, typename T>
__device__ inline OffsetT lower_bound(InputIteratorT input, OffsetT num_items, T val)#

Returns the offset of the first value within input which does not compare less than val.

Template Parameters:
  • InputIteratorT – [inferred] Type of iterator for the input data to be searched

  • OffsetT – [inferred] The data type of num_items

  • T – [inferred] The data type of the input sequence elements

Parameters:
  • input – [in] Input sequence

  • num_items – [in] Input sequence length

  • val – [in] Search Key

Returns:

Offset at which val was found

template<typename InputIteratorT, typename OffsetT, typename T>
__device__ inline OffsetT upper_bound(InputIteratorT input, OffsetT num_items, T val)#

Returns the offset of the first value within input which compares greater than val.

Template Parameters:
  • InputIteratorT – [inferred] Type of iterator for the input data to be searched

  • OffsetT – [inferred] The data type of num_items

  • T – [inferred] The data type of the input sequence elements

Parameters:
  • input – [in] Input sequence

  • num_items – [in] Input sequence length

  • val – [in] Search Key

Returns:

Offset at which val was found

template<int MaxNumItems, typename InputIteratorT, typename OffsetT, typename T>
__device__ inline OffsetT static_upper_bound(InputIteratorT input, OffsetT num_items, T val)#

Returns the offset of the first value within input which compares greater than val computed as a statically unrolled loop.

Template Parameters:
  • MaxNumItems – The maximum number of items.

  • InputIteratorT – [inferred] Type of iterator for the input data to be searched

  • OffsetT – [inferred] The data type of num_items

  • T – [inferred] The data type of the input sequence elements

Parameters:
  • input – [in] Input sequence

  • num_items – [in] Input sequence length

  • val – [in] Search Key

Returns:

Offset at which val was found

previous

Scan

next

Store

Contents
  • merge_path_search()
  • lower_bound()
  • upper_bound()
  • static_upper_bound()

  • Terms and Conditions
  • ROCm Licenses and Disclaimers
  • Privacy
  • Trademarks
  • Statement on Forced Labor
  • Fair and Open Competition
  • UK Tax Strategy
  • Cookie Policy
  • Cookie Settings
© 2025 Advanced Micro Devices, Inc