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

Function equal

include/hipSYCL/algorithms/algorithm.hpp:1137–1154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1135
1136template <class ForwardIt1, class ForwardIt2>
1137sycl::event equal(sycl::queue &q,
1138 ForwardIt1 first1, ForwardIt1 last1, ForwardIt2 first2,
1139 detail::early_exit_flag_t* out, const std::vector<sycl::event>& deps= {}) {
1140 std::size_t problem_size = std::distance(first1, last1);
1141 if(problem_size == 0)
1142 return sycl::event{};
1143 auto evt = detail ::early_exit_for_each(q, problem_size, out,
1144 [=](sycl::id<1> idx) -> bool {
1145 auto it1 = first1;
1146 auto it2 = first2;
1147 std::advance(it1, idx[0]);
1148 std::advance(it2, idx[0]);
1149 return !(*it1 == *it2);
1150 }, deps);
1151 return q.single_task(evt, [=](){
1152 *out = static_cast<detail::early_exit_flag_t>(!(*out));
1153 });
1154}
1155
1156template <class ForwardIt1, class ForwardIt2, class BinaryPred>
1157sycl::event equal(sycl::queue &q,

Callers 1

test_equalFunction · 0.50

Calls 2

early_exit_for_eachFunction · 0.85
single_taskMethod · 0.45

Tested by 1

test_equalFunction · 0.40