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

Function remove

include/hipSYCL/algorithms/algorithm.hpp:381–400  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

379
380template <class ForwardIt, class T>
381sycl::event remove(sycl::queue &q, util::allocation_group &scratch_allocations,
382 ForwardIt first, ForwardIt last, const T &value,
383 std::size_t *num_elements_copied = nullptr,
384 const std::vector<sycl::event> &deps = {}) {
385 if(first == last) {
386 if(num_elements_copied)
387 *num_elements_copied = 0;
388 return sycl::event{};
389 }
390
391 T* device_buffer = scratch_allocations.obtain<T>(std::distance(first, last));
392
393 auto pred = [value](auto x){ return !(x == value); };
394 auto evt = copy_if(q, scratch_allocations, first, last, device_buffer, pred,
395 num_elements_copied, deps);
396
397 evt.wait();
398 return copy_n(q, &(*device_buffer), *num_elements_copied, first,
399 deps);
400}
401
402template <class ForwardIt, class UnaryPredicate>
403sycl::event remove_if(sycl::queue &q, util::allocation_group &scratch_allocations,

Callers

nothing calls this directly

Calls 3

copy_ifFunction · 0.70
copy_nFunction · 0.70
waitMethod · 0.45

Tested by

no test coverage detected