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

Function remove_if

include/hipSYCL/algorithms/algorithm.hpp:403–423  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

401
402template <class ForwardIt, class UnaryPredicate>
403sycl::event remove_if(sycl::queue &q, util::allocation_group &scratch_allocations,
404 ForwardIt first, ForwardIt last, UnaryPredicate pred,
405 std::size_t *num_elements_copied = nullptr,
406 const std::vector<sycl::event> &deps = {}) {
407 if(first == last) {
408 if(num_elements_copied)
409 *num_elements_copied = 0;
410 return sycl::event{};
411 }
412
413 using ValueT = typename std::iterator_traits<ForwardIt>::value_type;
414 ValueT* device_buffer = scratch_allocations.obtain<ValueT>(std::distance(first, last));
415
416 auto op = [pred](auto x){ return !pred(x); };
417 auto evt = copy_if(q, scratch_allocations, first, last, device_buffer, op,
418 num_elements_copied, deps);
419
420 evt.wait();
421 return copy_n(q, &(*device_buffer), *num_elements_copied, first,
422 deps);
423}
424
425template <class ForwardIt1, class ForwardIt2, class UnaryPredicate>
426sycl::event remove_copy_if(sycl::queue &q, util::allocation_group &scratch_allocations,

Callers 8

unregister_hcf_objectMethod · 0.50
release_dead_usersMethod · 0.50
submitFunction · 0.50
add_requirementMethod · 0.50
test_remove_ifFunction · 0.50
add_userMethod · 0.50

Calls 3

copy_ifFunction · 0.70
copy_nFunction · 0.70
waitMethod · 0.45

Tested by 1

test_remove_ifFunction · 0.40