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] Implement unravel for mdspan. #629

Closed
trivialfis opened this issue Apr 26, 2022 · 1 comment
Closed

[FEA] Implement unravel for mdspan. #629

trivialfis opened this issue Apr 26, 2022 · 1 comment
Labels
feature request New feature or request inactive-30d

Comments

@trivialfis
Copy link
Member

This is an analog to numpy unravel index: https://numpy.org/doc/stable/reference/generated/numpy.unravel_index.html We often use a single index for parallel launchers like thrust::for_each, but need to index into types like matrix that have more than 1 dimension. unravel index can help us map the computation onto the parallel threads.

@github-actions
Copy link

This issue has been labeled inactive-30d due to no recent activity in the past 30 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be labeled inactive-90d if there is no activity in the next 60 days.

rapids-bot bot pushed a commit that referenced this issue Jun 29, 2022
Revised version of #631 with `thrust::tuple` replaced by `std::tuple` and custom `apply` function replaced by `std::apply`.

Related: #629

The implementation is mostly copied from XGBoost  https://github.com/dmlc/xgboost/blob/fdf533f2b9af9c068cddba50839574c6abb58dc3/include/xgboost/linalg.h#L523 .

In the tests, I have used both `__host__ __device__` and `__device__` lambdas to make sure `std::tuple` and `std::apply` are working correctly with CUDA kernel.

Authors:
  - Jiaming Yuan (https://github.com/trivialfis)

Approvers:
  - Divye Gala (https://github.com/divyegala)
  - Corey J. Nolet (https://github.com/cjnolet)

URL: #723
@cjnolet cjnolet closed this as completed Jul 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request inactive-30d
Projects
None yet
Development

No branches or pull requests

2 participants