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

Move lists utility function definition out of header #7266

Merged
merged 7 commits into from
Feb 4, 2021

Conversation

mythrocks
Copy link
Contributor

Fixes #7265.

cudf::detail::get_num_child_rows() is currently defined in cudf/lists/detail/utilities.cuh. The build pipelines for #7189 are fine, but there seem to be build failures in dependent projects such as spark-rapids:

[2021-01-31T08:12:10.611Z] /.../workspace/spark/cudf18_nightly/cpp/include/cudf/lists/detail/utilities.cuh:31:18: error: 'cudf::size_type cudf::detail::get_num_child_rows(const cudf::column_view&, rmm::cuda_stream_view)' defined but not used [-Werror=unused-function]
[2021-01-31T08:12:10.611Z]  static cudf::size_type get_num_child_rows(cudf::column_view const& list_offsets,
[2021-01-31T08:12:10.611Z]                   ^~~~~~~~~~~~~~~~~~
[2021-01-31T08:12:11.981Z] cc1plus: all warnings being treated as errors
[2021-01-31T08:12:12.238Z] make[2]: *** [CMakeFiles/cudf_hash.dir/build.make:82: CMakeFiles/cudf_hash.dir/src/hash/hashing.cu.o] Error 1
[2021-01-31T08:12:12.238Z] make[1]: *** [CMakeFiles/Makefile2:220: CMakeFiles/cudf_hash.dir/all] Error 2

In any case, it is less than ideal for the function to be completely defined in the header, especially given that the likes of hashing.cu are exposed to it (by way of scatter.cuh).

This commit moves the function definition to a separate translation unit, without changing implementation or interface.

@mythrocks mythrocks self-assigned this Feb 1, 2021
@mythrocks mythrocks requested a review from a team as a code owner February 1, 2021 07:53
@mythrocks mythrocks added 3 - Ready for Review Ready for review by team 4 - Needs Review Waiting for reviewer to review or respond bug Something isn't working code quality non-breaking Non-breaking change labels Feb 1, 2021
@codecov
Copy link

codecov bot commented Feb 1, 2021

Codecov Report

Merging #7266 (710a2cf) into branch-0.18 (8860baf) will increase coverage by 0.11%.
The diff coverage is n/a.

Impacted file tree graph

@@               Coverage Diff               @@
##           branch-0.18    #7266      +/-   ##
===============================================
+ Coverage        82.09%   82.20%   +0.11%     
===============================================
  Files               97      100       +3     
  Lines            16474    16952     +478     
===============================================
+ Hits             13524    13936     +412     
- Misses            2950     3016      +66     
Impacted Files Coverage Δ
python/cudf/cudf/__init__.py 100.00% <ø> (ø)
python/cudf/cudf/_fuzz_testing/avro.py 0.00% <ø> (ø)
python/cudf/cudf/_fuzz_testing/csv.py 0.00% <ø> (ø)
python/cudf/cudf/_fuzz_testing/fuzzer.py 0.00% <ø> (ø)
python/cudf/cudf/_fuzz_testing/io.py 0.00% <ø> (ø)
python/cudf/cudf/_fuzz_testing/json.py 0.00% <ø> (ø)
python/cudf/cudf/_fuzz_testing/main.py 0.00% <ø> (ø)
python/cudf/cudf/_fuzz_testing/orc.py 0.00% <ø> (ø)
python/cudf/cudf/_fuzz_testing/parquet.py 0.00% <ø> (ø)
python/cudf/cudf/_fuzz_testing/utils.py 0.00% <ø> (ø)
... and 83 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 900c1e1...3fb4965. Read the comment docs.

@davidwendt
Copy link
Contributor

Just an observation. Neither the .cuh nor the .cu file have any device code in them. So I think these could just be .hpp and .cpp files respectively instead.
You may need to include cuda_runtime.h in the .cpp file for the cudaMemcpyAsync declaration.

cpp/src/lists/utilities.cu Outdated Show resolved Hide resolved
@mythrocks
Copy link
Contributor Author

@davidwendt, I've switched these to .hpp/.cpp. I've retested.

@mythrocks mythrocks requested a review from a team as a code owner February 1, 2021 18:56
Copy link
Contributor

@hyperbolic2346 hyperbolic2346 left a comment

Choose a reason for hiding this comment

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

Replacing new code with existing, identical code. I like your style!

@mythrocks mythrocks removed request for a team, karthikeyann and vuule February 1, 2021 22:52
@mythrocks
Copy link
Contributor Author

Letting @vuule, @karthikeyann, and @rapidsai/ops-codeowners off the hook on this one.

Thanks for the reviews, @davidwendt, @nvdbaranec, @hyperbolic2346!

@mythrocks mythrocks added the 5 - Ready to Merge Testing and reviews complete, ready to merge label Feb 1, 2021
@mythrocks
Copy link
Contributor Author

rerun tests

@harrism harrism removed 3 - Ready for Review Ready for review by team 4 - Needs Review Waiting for reviewer to review or respond labels Feb 2, 2021
@mythrocks
Copy link
Contributor Author

rerun tests

@mythrocks
Copy link
Contributor Author

@kkraus14, could this PR please be merged? I'm afraid the spark-rapids builds are broken without this change.
I'm not sure why it didn't merge automatically after the tests ran.

@kkraus14
Copy link
Collaborator

kkraus14 commented Feb 4, 2021

@gpucibot merge

@rapids-bot rapids-bot bot merged commit fd38b4c into rapidsai:branch-0.18 Feb 4, 2021
@mythrocks mythrocks deleted the fix-build-list-utilities branch February 4, 2021 04:58
@mythrocks
Copy link
Contributor Author

mythrocks commented Feb 4, 2021

@kkraus14, Thank you! Wow, that was quick.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Ready to Merge Testing and reviews complete, ready to merge bug Something isn't working non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] cuDF cpp build error utilities.cuh: "get_num_child_rows defined but not used'
6 participants