@@ -284,17 +284,12 @@ template <class Key,
284284 class ProbingScheme ,
285285 class Allocator ,
286286 class Storage >
287- template <class InputProbeIt , class OutputProbeIt , class OutputMatchIt >
288- std::pair<OutputProbeIt, OutputMatchIt>
289- static_multiset<Key, Extent, Scope, KeyEqual, ProbingScheme, Allocator, Storage>::retrieve(
290- InputProbeIt first,
291- InputProbeIt last,
292- OutputProbeIt output_probe,
293- OutputMatchIt output_match,
294- cuda::stream_ref stream) const
287+ template <typename CallbackOp>
288+ void static_multiset<Key, Extent, Scope, KeyEqual, ProbingScheme, Allocator, Storage>::for_each(
289+ CallbackOp&& callback_op, cuda::stream_ref stream) const
295290{
296- return this -> impl_ ->retrieve (
297- first, last, output_probe, output_match, this -> ref (op::retrieve), stream);
291+ impl_->for_each_async (std::forward<CallbackOp>(callback_op), stream);
292+ stream. wait ( );
298293}
299294
300295template <class Key ,
@@ -304,24 +299,11 @@ template <class Key,
304299 class ProbingScheme ,
305300 class Allocator ,
306301 class Storage >
307- template <class InputProbeIt ,
308- class ProbeEqual ,
309- class ProbeHash ,
310- class OutputProbeIt ,
311- class OutputMatchIt >
312- std::pair<OutputProbeIt, OutputMatchIt>
313- static_multiset<Key, Extent, Scope, KeyEqual, ProbingScheme, Allocator, Storage>::retrieve(
314- InputProbeIt first,
315- InputProbeIt last,
316- ProbeEqual const & probe_equal,
317- ProbeHash const & probe_hash,
318- OutputProbeIt output_probe,
319- OutputMatchIt output_match,
320- cuda::stream_ref stream) const
302+ template <typename CallbackOp>
303+ void static_multiset<Key, Extent, Scope, KeyEqual, ProbingScheme, Allocator, Storage>::
304+ for_each_async (CallbackOp&& callback_op, cuda::stream_ref stream) const
321305{
322- auto const probe_ref =
323- this ->ref (op::retrieve).rebind_key_eq (probe_equal).rebind_hash_function (probe_hash);
324- return this ->impl_ ->retrieve (first, last, output_probe, output_match, probe_ref, stream);
306+ impl_->for_each_async (std::forward<CallbackOp>(callback_op), stream);
325307}
326308
327309template <class Key ,
@@ -331,24 +313,31 @@ template <class Key,
331313 class ProbingScheme ,
332314 class Allocator ,
333315 class Storage >
334- template <class InputProbeIt ,
335- class ProbeEqual ,
336- class ProbeHash ,
337- class OutputProbeIt ,
338- class OutputMatchIt >
339- std::pair<OutputProbeIt, OutputMatchIt>
340- static_multiset<Key, Extent, Scope, KeyEqual, ProbingScheme, Allocator, Storage>::retrieve_outer(
341- InputProbeIt first,
342- InputProbeIt last,
343- ProbeEqual const & probe_equal,
344- ProbeHash const & probe_hash,
345- OutputProbeIt output_probe,
346- OutputMatchIt output_match,
347- cuda::stream_ref stream) const
316+ template <typename InputIt, typename CallbackOp>
317+ void static_multiset<Key, Extent, Scope, KeyEqual, ProbingScheme, Allocator, Storage>::for_each(
318+ InputIt first, InputIt last, CallbackOp&& callback_op, cuda::stream_ref stream) const
348319{
349- auto const probe_ref =
350- this ->ref (op::retrieve).rebind_key_eq (probe_equal).rebind_hash_function (probe_hash);
351- return this ->impl_ ->retrieve_outer (first, last, output_probe, output_match, probe_ref, stream);
320+ impl_->for_each_async (
321+ first, last, std::forward<CallbackOp>(callback_op), ref (op::for_each), stream);
322+ stream.wait ();
323+ }
324+
325+ template <class Key ,
326+ class Extent ,
327+ cuda::thread_scope Scope,
328+ class KeyEqual ,
329+ class ProbingScheme ,
330+ class Allocator ,
331+ class Storage >
332+ template <typename InputIt, typename CallbackOp>
333+ void static_multiset<Key, Extent, Scope, KeyEqual, ProbingScheme, Allocator, Storage>::
334+ for_each_async (InputIt first,
335+ InputIt last,
336+ CallbackOp&& callback_op,
337+ cuda::stream_ref stream) const noexcept
338+ {
339+ impl_->for_each_async (
340+ first, last, std::forward<CallbackOp>(callback_op), ref (op::for_each), stream);
352341}
353342
354343template <class Key ,
@@ -412,6 +401,79 @@ static_multiset<Key, Extent, Scope, KeyEqual, ProbingScheme, Allocator, Storage>
412401 stream);
413402}
414403
404+ template <class Key ,
405+ class Extent ,
406+ cuda::thread_scope Scope,
407+ class KeyEqual ,
408+ class ProbingScheme ,
409+ class Allocator ,
410+ class Storage >
411+ template <class InputProbeIt , class OutputProbeIt , class OutputMatchIt >
412+ std::pair<OutputProbeIt, OutputMatchIt>
413+ static_multiset<Key, Extent, Scope, KeyEqual, ProbingScheme, Allocator, Storage>::retrieve(
414+ InputProbeIt first,
415+ InputProbeIt last,
416+ OutputProbeIt output_probe,
417+ OutputMatchIt output_match,
418+ cuda::stream_ref stream) const
419+ {
420+ return impl_->retrieve (first, last, output_probe, output_match, this ->ref (op::retrieve), stream);
421+ }
422+
423+ template <class Key ,
424+ class Extent ,
425+ cuda::thread_scope Scope,
426+ class KeyEqual ,
427+ class ProbingScheme ,
428+ class Allocator ,
429+ class Storage >
430+ template <class InputProbeIt ,
431+ class ProbeEqual ,
432+ class ProbeHash ,
433+ class OutputProbeIt ,
434+ class OutputMatchIt >
435+ std::pair<OutputProbeIt, OutputMatchIt>
436+ static_multiset<Key, Extent, Scope, KeyEqual, ProbingScheme, Allocator, Storage>::retrieve(
437+ InputProbeIt first,
438+ InputProbeIt last,
439+ ProbeEqual const & probe_equal,
440+ ProbeHash const & probe_hash,
441+ OutputProbeIt output_probe,
442+ OutputMatchIt output_match,
443+ cuda::stream_ref stream) const
444+ {
445+ auto const probe_ref =
446+ this ->ref (op::retrieve).rebind_key_eq (probe_equal).rebind_hash_function (probe_hash);
447+ return impl_->retrieve (first, last, output_probe, output_match, probe_ref, stream);
448+ }
449+
450+ template <class Key ,
451+ class Extent ,
452+ cuda::thread_scope Scope,
453+ class KeyEqual ,
454+ class ProbingScheme ,
455+ class Allocator ,
456+ class Storage >
457+ template <class InputProbeIt ,
458+ class ProbeEqual ,
459+ class ProbeHash ,
460+ class OutputProbeIt ,
461+ class OutputMatchIt >
462+ std::pair<OutputProbeIt, OutputMatchIt>
463+ static_multiset<Key, Extent, Scope, KeyEqual, ProbingScheme, Allocator, Storage>::retrieve_outer(
464+ InputProbeIt first,
465+ InputProbeIt last,
466+ ProbeEqual const & probe_equal,
467+ ProbeHash const & probe_hash,
468+ OutputProbeIt output_probe,
469+ OutputMatchIt output_match,
470+ cuda::stream_ref stream) const
471+ {
472+ auto const probe_ref =
473+ this ->ref (op::retrieve).rebind_key_eq (probe_equal).rebind_hash_function (probe_hash);
474+ return impl_->retrieve_outer (first, last, output_probe, output_match, probe_ref, stream);
475+ }
476+
415477template <class Key ,
416478 class Extent ,
417479 cuda::thread_scope Scope,
0 commit comments