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

replace auto with auto& ref for cast<&> #8866

Merged
merged 2 commits into from
Jul 29, 2021

Conversation

karthikeyann
Copy link
Contributor

While debugging a 'scalar out of bounds memory issue' in compiled binary ops, found that auto is used instead of auto& for dynamic/static_cast<&>.
Using auto, causes to create a copy. (calls copy constructor).
But the intention of cast<&> is to create a ref variable.

This PR addresses several use cases in libcudf code of auto for dynamic/static_cast<&>.

@karthikeyann karthikeyann added bug Something isn't working 3 - Ready for Review Ready for review by team 4 - Needs Review Waiting for reviewer to review or respond tech debt non-breaking Non-breaking change labels Jul 27, 2021
@karthikeyann karthikeyann requested a review from a team as a code owner July 27, 2021 19:13
@github-actions github-actions bot added the libcudf Affects libcudf (C++/CUDA) code. label Jul 27, 2021
@karthikeyann
Copy link
Contributor Author

@davidwendt There is a comment mentioning this issue.

// note: using static_cast<scalar_type_t<IndexType> const&>(index) creates a copy

@karthikeyann
Copy link
Contributor Author

rerun tests

Copy link
Contributor

@davidwendt davidwendt left a comment

Choose a reason for hiding this comment

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

Nice work.

@karthikeyann
Copy link
Contributor Author

karthikeyann commented Jul 28, 2021

Ran all libcudf tests with --rmm_mode=cuda

The following tests FAILED:
2 - SCALAR_TEST (Failed)
22 - BINARY_TEST (Failed)
32 - COPYING_TEST (Failed)
39 - MERGE_TEST (Failed)
46 - FACTORIES_TEST (Failed)

With this PR, still
The following tests FAILED:
2 - SCALAR_TEST (Failed)
32 - COPYING_TEST (Failed)
39 - MERGE_TEST (Failed)
46 - FACTORIES_TEST (Failed)

Created a new issue #8883 to track this.

@harrism
Copy link
Member

harrism commented Jul 28, 2021

rerun tests

@codecov
Copy link

codecov bot commented Jul 29, 2021

Codecov Report

Merging #8866 (c07c179) into branch-21.10 (18f7c01) will decrease coverage by 0.08%.
The diff coverage is n/a.

❗ Current head c07c179 differs from pull request most recent head b4deb5d. Consider uploading reports for the commit b4deb5d to get more accurate results
Impacted file tree graph

@@               Coverage Diff                @@
##           branch-21.10    #8866      +/-   ##
================================================
- Coverage         10.67%   10.59%   -0.09%     
================================================
  Files               110      116       +6     
  Lines             18271    19037     +766     
================================================
+ Hits               1951     2017      +66     
- Misses            16320    17020     +700     
Impacted Files Coverage Δ
python/cudf/cudf/__init__.py 0.00% <ø> (ø)
python/cudf/cudf/core/__init__.py 0.00% <ø> (ø)
python/cudf/cudf/core/column/categorical.py 0.00% <ø> (ø)
python/cudf/cudf/core/column/column.py 0.00% <ø> (ø)
python/cudf/cudf/core/column/lists.py 0.00% <ø> (ø)
python/cudf/cudf/core/column/numerical.py 0.00% <ø> (ø)
python/cudf/cudf/core/column/string.py 0.00% <ø> (ø)
python/cudf/cudf/core/column/struct.py 0.00% <ø> (ø)
python/cudf/cudf/core/dataframe.py 0.00% <ø> (ø)
python/cudf/cudf/core/frame.py 0.00% <ø> (ø)
... and 75 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 d7ba345...b4deb5d. Read the comment docs.

@harrism
Copy link
Member

harrism commented Jul 29, 2021

@gpucibot merge

@rapids-bot rapids-bot bot merged commit 92d4335 into rapidsai:branch-21.10 Jul 29, 2021
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 4 - Needs Review Waiting for reviewer to review or respond bug Something isn't working 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