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

Use vector factories for host-device copies. #9806

Merged
merged 1 commit into from
Dec 6, 2021

Conversation

bdice
Copy link
Contributor

@bdice bdice commented Dec 1, 2021

See: #9588 (comment)

In a recent PR review, @jrhemstad suggested switching to vector factories for one-way host-device data copying (that is, cases where using a hostdevice_vector isn't the right choice).

This PR applies that suggestion more broadly across the code base, replacing a number of simple cases where a (device) vector was being constructed followed by a call to CUDA_TRY(cudaMemcpyAsync(...)) with the corresponding factory functions. This makes the code a little more concise and encourages broader use of these factory functions in the future.

@bdice bdice added 3 - Ready for Review Ready for review by team code quality libcudf Affects libcudf (C++/CUDA) code. improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Dec 1, 2021
@bdice bdice self-assigned this Dec 1, 2021
@bdice bdice requested a review from a team as a code owner December 1, 2021 03:27
@bdice bdice requested review from mythrocks and jrhemstad December 1, 2021 03:27
@codecov
Copy link

codecov bot commented Dec 1, 2021

Codecov Report

Merging #9806 (0178d83) into branch-22.02 (967a333) will decrease coverage by 0.01%.
The diff coverage is 9.24%.

Impacted file tree graph

@@               Coverage Diff                @@
##           branch-22.02    #9806      +/-   ##
================================================
- Coverage         10.49%   10.47%   -0.02%     
================================================
  Files               119      119              
  Lines             20305    20368      +63     
================================================
+ Hits               2130     2133       +3     
- Misses            18175    18235      +60     
Impacted Files Coverage Δ
python/cudf/cudf/__init__.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/column/column.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/column/string.py 0.00% <ø> (ø)
python/cudf/cudf/core/frame.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/groupby/groupby.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/index.py 0.00% <ø> (ø)
python/cudf/cudf/core/indexed_frame.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/multiindex.py 0.00% <0.00%> (ø)
python/cudf/cudf/utils/utils.py 0.00% <0.00%> (ø)
python/dask_cudf/dask_cudf/io/csv.py 96.00% <100.00%> (+0.10%) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 991136c...0178d83. Read the comment docs.

Copy link
Contributor

@mythrocks mythrocks left a comment

Choose a reason for hiding this comment

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

LGTM!

@bdice
Copy link
Contributor Author

bdice commented Dec 6, 2021

@gpucibot merge

@rapids-bot rapids-bot bot merged commit 8ceed73 into rapidsai:branch-22.02 Dec 6, 2021
@bdice bdice deleted the use-vector-factories branch December 7, 2021 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Ready for Review Ready for review by team improvement Improvement / enhancement to an existing function libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants