Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEA] static_map::insert_if #116

Closed
PointKernel opened this issue Nov 9, 2021 · 1 comment · Fixed by #118
Closed

[FEA] static_map::insert_if #116

PointKernel opened this issue Nov 9, 2021 · 1 comment · Fixed by #118
Assignees

Comments

@PointKernel
Copy link
Member

Is your feature request related to a problem? Please describe.
Given a set of key/value pairs, insert pair[i] if predicate of stencil[i] returns true. The API should be similar to static_mulimap::insert_if:

  /**
   * @brief Inserts key/value pairs in the range `[first, last)` if `pred`
   * of the corresponding stencil returns true.
   *
   * The key/value pair `*(first + i)` is inserted if `pred( *(stencil + i) )` returns true.
   *
   * @tparam InputIt Device accessible random access input iterator where
   * `std::is_convertible<std::iterator_traits<InputIt>::value_type,
   * static_map<K, V>::value_type>` is `true`
   * @tparam StencilIt Device accessible random access iterator whose value_type is
   * convertible to Predicate's argument type
   * @tparam Predicate Unary predicate callable whose return type must be convertible to `bool` and
   * argument type is convertible from `std::iterator_traits<StencilIt>::value_type`.
   * @param first Beginning of the sequence of key/value pairs
   * @param last End of the sequence of key/value pairs
   * @param stencil Beginning of the stencil sequence
   * @param pred Predicate to test on every element in the range `[stencil, stencil +
   * std::distance(first, last))`
   * @param stream CUDA stream used for insert
   */
  template <typename InputIt, typename StencilIt, typename Predicate>
  void insert_if(
    InputIt first, InputIt last, StencilIt stencil, Predicate pred, cudaStream_t stream = 0);

Additional context
Required by cudf semi/anti join refactoring

@vyasr
Copy link
Collaborator

vyasr commented Nov 9, 2021

@PointKernel can you assign me? I've already started looking into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants