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

Function replace

include/hipSYCL/algorithms/algorithm.hpp:436–445  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

434
435template <class ForwardIt, class T>
436sycl::event replace(sycl::queue &q, ForwardIt first, ForwardIt last,
437 const T &old_value, const T &new_value,
438 const std::vector<sycl::event> &deps = {}) {
439 if(first == last)
440 return sycl::event{};
441 return for_each(q, first, last,[=](auto& x){
442 if(x == old_value)
443 x = new_value;
444 }, deps);
445}
446
447template <class ForwardIt, class UnaryPredicate, class T>
448sycl::event replace_if(sycl::queue &q, ForwardIt first, ForwardIt last,

Callers 1

test_replaceFunction · 0.50

Calls 1

for_eachFunction · 0.70

Tested by 1

test_replaceFunction · 0.40