Skip to content

Add host-bulk for_each for static_map#565

Merged
sleeepyjack merged 23 commits intoNVIDIA:devfrom
srinivasyadav18:for_each
Aug 13, 2024
Merged

Add host-bulk for_each for static_map#565
sleeepyjack merged 23 commits intoNVIDIA:devfrom
srinivasyadav18:for_each

Conversation

@srinivasyadav18
Copy link
Copy Markdown
Contributor

This PR adds two overloads of host-bulk for_each API for static_map.

  1. for_each(Callback callback_op)
    executes callback_op on every filled element in the map.

  2. for_each(InputIt first, IntputIt last, CallbackOp callback_op)
    executes callback_op on every matched slot with key equals to a key from the input sequence.

@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot bot commented Jul 29, 2024

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@sleeepyjack
Copy link
Copy Markdown
Collaborator

/ok to test

@PointKernel PointKernel added topic: static_map Issue related to the static_map type: feature request New feature request Needs Review Awaiting reviews before merging labels Jul 30, 2024
@sleeepyjack
Copy link
Copy Markdown
Collaborator

/ok to test

Copy link
Copy Markdown
Collaborator

@sleeepyjack sleeepyjack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM apart from the missing deallocate(tmp)

@PointKernel
Copy link
Copy Markdown
Member

This PR adds two overloads of host-bulk for_each API for static_map.

  1. for_each(Callback callback_op)
    executes callback_op on every filled element in the map.
  2. for_each(InputIt first, IntputIt last, CallbackOp callback_op)
    executes callback_op on every matched slot with key equals to a key from the input sequence.

With the first overload no longer desired by libcudf, shall we remove it from the current PR?

@sleeepyjack
Copy link
Copy Markdown
Collaborator

@PointKernel the first overload was requested (or better proposed by me) in this thread (NV internal): https://nvidia.enterprise.slack.com/archives/CRJDZ0SKG/p1721975163922999

I think this overload is useful in general as it enables functionality similar to the begin/end iterators in STL containers.

@PointKernel
Copy link
Copy Markdown
Member

/ok to test

@sleeepyjack
Copy link
Copy Markdown
Collaborator

/ok to test

@PointKernel
Copy link
Copy Markdown
Member

/ok to test

@PointKernel
Copy link
Copy Markdown
Member

/ok to test

@PointKernel
Copy link
Copy Markdown
Member

/ok to test

@sleeepyjack sleeepyjack merged commit 118fd1f into NVIDIA:dev Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review Awaiting reviews before merging topic: static_map Issue related to the static_map type: feature request New feature request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants