Contents Menu Expand Light mode Dark mode Auto light/dark mode
Kokkos documentation
Kokkos documentation
  • Programming Guide
    • 1. Introduction
    • 2. Machine Model
    • 3: Programming Model
    • 4. Compiling
    • 5. Initialization
    • 6: View: Multidimensional array
    • 7. Parallel dispatch
    • 8. Hierarchical Parallelism
    • 9. Custom Reductions
      • 9.1 Built-In-Reducers
      • 9.2 Built-In Reducers with Custom Scalar Types
      • 9.3 Custom Reducers
    • 10. Atomic Operations
    • 11: Subviews
    • 12 Backwards & Future Compatibility
    • 13. Interoperability and Legacy Codes
    • 14. Kokkos and Virtual Functions
    • 15. SIMD Types
  • Requirements
  • Build, Install and Use
  • CMake Keywords
  • API: Core
    • Initialize and Finalize
      • initialize
      • finalize
      • ScopeGuard
      • InitializationSettings
      • InitArguments
    • View and related
      • create_mirror[_view]
      • deep_copy
      • LayoutLeft
      • LayoutRight
      • LayoutStride
      • realloc
      • resize
      • subview
      • Kokkos::Subview
      • View
      • view_alloc
      • View-like Types
    • Parallel Execution/Dispatch
      • parallel_for
      • parallel_reduce
      • parallel_scan
      • fence
      • ParallelForTag
      • ParallelReduceTag
      • ParallelScanTag
    • Built-in Reducers
      • ReducerConcept
      • BAnd
      • BOr
      • LAnd
      • LOr
      • Max
      • MaxLoc
      • Min
      • MinLoc
      • MinMax
      • MinMaxLoc
      • Prod
      • Sum
      • Reduction Scalar Types
        • MinMaxLocScalar
        • MinMaxScalar
        • ValLocScalar
    • Execution Policies
      • ExecutionPolicy
      • MDRangePolicy
      • NestedPolicies
      • RangePolicy
      • TeamHandleConcept
      • TeamPolicy
      • TeamThreadMDRange
      • TeamThreadRange
      • TeamVectorMDRange
      • TeamVectorRange
      • ThreadVectorMDRange
      • ThreadVectorRange
    • Spaces
      • Execution Spaces
      • partition_space
      • Memory Spaces
      • Space Accessibility
    • Task-Parallelism
    • Atomics
      • atomic_compare_exchange
      • atomic_compare_exchange_strong
      • atomic_exchange
      • atomic_fetch_[op]
      • atomic_load
      • atomic_[op]
      • atomic_[op]_fetch
      • atomic_store
    • Numerics
      • Mathematical constants
      • Common math functions
      • Numeric traits
      • Bit manipulation
    • C-style memory management
      • kokkos_malloc
      • kokkos_realloc
      • kokkos_free
    • Traits
    • Kokkos Concepts
    • STL Compatibility Issues
      • Kokkos::pair
    • Utilities
      • Kokkos::abort
      • Kokkos::ALL
      • KOKKOS_ASSERT
      • Kokkos::complex
      • Minimum/maximum operations
      • Kokkos::printf
      • Kokkos::Timer
      • Kokkos::device_id
      • Kokkos::num_threads
      • Kokkos::Experimental
    • Detection Idiom
    • Macros
  • API: Containers
    • Bitset
    • ConstBitset
    • DualView
    • DynamicView
    • DynRankView
    • OffsetView
    • ScatterView
    • StaticCrsGraph
    • UnorderedMap
    • vector
  • API: Algorithms
    • Random-Number
    • Generator
    • Sort
    • Sorting with nested policies (team- and thread-level)
    • Std Algorithms
      • Iterators
      • Minimum/maximum
        • min_element
        • max_element
        • minmax_element
      • Modifying Sequence
        • copy
        • copy_if
        • copy_n
        • copy_backward
        • move
        • move_backward
        • fill
        • fill_n
        • transform
        • generate
        • generate_n
        • remove
        • remove_if
        • remove_copy
        • remove_copy_if
        • replace
        • replace_if
        • replace_copy
        • replace_copy_if
        • swap_ranges
        • reverse
        • reverse_copy
        • rotate
        • rotate_copy
        • shift_left
        • shift_right
        • unique
        • unique_copy
      • Non-modifying Sequence
        • adjacent_find
        • count
        • count_if
        • equal
        • all_of
        • any_of
        • none_of
        • find
        • find_if
        • find_if_not
        • find_end
        • find_first_of
        • for_each
        • for_each_n
        • lexicographical_compare
        • mismatch
        • search
        • search_n
      • Numeric
        • adjacent_difference
        • reduce
        • exclusive_scan
        • inclusive_scan
        • transform_reduce
        • transform_exclusive_scan
        • transform_inclusive_scan
      • Partitioning
        • is_partitioned
        • partition_point
        • partition_copy
      • Sorting
        • is_sorted
        • is_sorted_until
  • API: SIMD
    • Experimental::simd
    • Experimental::simd_mask
    • Experimental::where_expression
  • API in Alphabetical Order
  • Deprecation for Kokkos-3.x
  • Known issues
  • Use Cases and Examples
    • MPI Halo Exchange
    • ScatterView averaging elements to nodes
    • MDRangePolicy Use Case
    • Virtual Functions
    • Tagged Operators
    • Overlapping Host and Device work
    • Kokkos Tasking Use Case
    • Fortran Interop Use Case
    • Array of Structures and Structure of Arrays with Cabana
    • Kokkos and Windows.h
    • Moving code from requiring Kokkos_ENABLE_CUDA_UVM to using SharedSpace
  • Kokkos Planning and Testing
    • Kokkos Project Planning
    • Requirements, Issues and Feedback
    • Attachments
    • Kokkos Testing Processes and Change Process
    • Kokkos Testing Workflow Components
  • Tutorials
  • Video lectures and slides
    • 1. Intro, Build, Parallel dispatch
    • 2. Views and Spaces
    • 3. Multidim loops and Data Structures
    • 4. Hierarchical Parallelism
    • 5. SIMD, Streams, Tasking
    • 6. Fortran/Python interop, MPI, PGAS
    • 7. Kokkos Tools
    • 8. Kokkos Kernels Math Library
  • GitHub Repo
  • Contributing
    • Documentation Templates
      • Class API Template
  • FAQ
  • Citing Kokkos
  • License
Back to top
Edit this page

search#

Header File: Kokkos_StdAlgorithms.hpp

namespace Kokkos{
namespace Experimental{

template <class ExecutionSpace, class IteratorType1, class IteratorType2>
IteratorType1 search(const ExecutionSpace& exespace, IteratorType1 first,
                     IteratorType1 last, IteratorType2 s_first,                      (1)
                     IteratorType2 s_last);

template <class ExecutionSpace, class IteratorType1, class IteratorType2>
IteratorType1 search(const std::string& label, const ExecutionSpace& exespace,
                     IteratorType1 first, IteratorType1 last,                        (2)
                     IteratorType2 s_first, IteratorType2 s_last);

template <class ExecutionSpace, class DataType1, class... Properties1,
          class DataType2, class... Properties2>
auto search(const ExecutionSpace& exespace,
            const ::Kokkos::View<DataType1, Properties1...>& view,                   (3)
            const ::Kokkos::View<DataType2, Properties2...>& s_view);

template <class ExecutionSpace, class DataType1, class... Properties1,
          class DataType2, class... Properties2>
auto search(const std::string& label, const ExecutionSpace& exespace,
            const ::Kokkos::View<DataType1, Properties1...>& view,                   (4)
            const ::Kokkos::View<DataType2, Properties2...>& s_view);

// overload set 2: binary predicate passed
template <class ExecutionSpace, class IteratorType1, class IteratorType2,
          class BinaryPredicateType>
IteratorType1 search(const ExecutionSpace& exespace, IteratorType1 first,                  (5)
                     IteratorType1 last, IteratorType2 s_first,
                     IteratorType2 s_last, const BinaryPredicateType& pred);

template <class ExecutionSpace, class IteratorType1, class IteratorType2,
          class BinaryPredicateType>
IteratorType1 search(const std::string& label, const ExecutionSpace& exespace,
                     IteratorType1 first, IteratorType1 last,                        (6)
                     IteratorType2 s_first, IteratorType2 s_last,
                     const BinaryPredicateType& pred);

template <class ExecutionSpace, class DataType1, class... Properties1,
          class DataType2, class... Properties2, class BinaryPredicateType>
auto search(const ExecutionSpace& exespace,
            const ::Kokkos::View<DataType1, Properties1...>& view,                   (7)
            const ::Kokkos::View<DataType2, Properties2...>& s_view,
            const BinaryPredicateType& pred);

template <class ExecutionSpace, class DataType1, class... Properties1,
          class DataType2, class... Properties2, class BinaryPredicateType>
auto search(const std::string& label, const ExecutionSpace& exespace,
            const ::Kokkos::View<DataType1, Properties1...>& view,                   (8)
            const ::Kokkos::View<DataType2, Properties2...>& s_view,
            const BinaryPredicateType& pred)

} //end namespace Experimental
} //end namespace Kokkos

Description#

Searches for the first occurrence of the sequence of elements [s_first, s_last) in the range [first, last) in (1,2,5,6). Searches for the first occurrence of the sequence of elements s_view in view in (3,4,7,8). Elements in (1,2,3,4) are compared using == and elements in (5,6,7,8) are compared using pred.

Parameters and Requirements#

  • exespace, s_first, s_last, first, last, s_view and view similar to mismatch.

  • label:

    • 1,5: The default string is “Kokkos::search_iterator_api_default”.

    • 3,7: The default string is “Kokkos::search_view_api_default”.

  • pred - similar to equal

Next
search_n
Previous
mismatch
Copyright © 2014, National Technology & Engineering Solutions of Sandia, LLC (NTESS)
Made with Sphinx and @pradyunsg's Furo
Contents
  • search
    • Description
    • Parameters and Requirements