MCPcopy Create free account
hub / github.com/AdaptiveCpp/AdaptiveCpp / mismatch

Function mismatch

include/hipSYCL/algorithms/algorithm.hpp:886–912  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

884
885template <class ForwardIt1, class ForwardIt2, class BinaryPredicate>
886sycl::event mismatch(sycl::queue &q, util::allocation_group &scratch_allocations,
887 ForwardIt1 first1, ForwardIt1 last1, ForwardIt2 first2,
888 ForwardIt2 last2, BinaryPredicate p,
889 typename std::iterator_traits<ForwardIt1>::difference_type* out,
890 const std::vector<sycl::event>& deps = {}) {
891 if (first1 == last1 || first2 == last2)
892 return sycl::event{};
893
894 using DiffT = typename std::iterator_traits<ForwardIt1>::difference_type;
895 DiffT problem_size = std::min(std::distance(first1, last1),
896 std::distance(first2, last2));
897
898 auto kernel = [=](sycl::id<1> idx, auto& reducer) {
899 auto input1 = std::next(first1, idx[0]);
900 auto input2 = std::next(first2, idx[0]);
901 if ( p(*input1, *input2) )
902 reducer.combine(problem_size);
903 else
904 reducer.combine(idx[0]);
905 };
906
907 auto reduce = sycl::minimum<DiffT>{};
908
909 return detail::transform_reduce_impl(q, scratch_allocations, out,
910 std::numeric_limits<DiffT>::max(),
911 problem_size, kernel, reduce, deps);
912}
913
914template <class ForwardIt1, class ForwardIt2, class BinaryPredicate>
915sycl::event mismatch(sycl::queue &q, util::allocation_group &scratch_allocations,

Callers 1

test_mismatchFunction · 0.50

Calls 4

minClass · 0.85
transform_reduce_implFunction · 0.85
maxClass · 0.85
combineMethod · 0.80

Tested by 1

test_mismatchFunction · 0.40