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

Fix debug compile error in device_span to column_view conversion #10331

Merged
merged 1 commit into from
Feb 19, 2022

Conversation

davidwendt
Copy link
Contributor

@davidwendt davidwendt commented Feb 18, 2022

Fixes a compile error in column_view(device_span) constructor when building libcudf in Debug.

Building CXX object tests/CMakeFi...TEST.dir/column/column_view_device_span_test.cpp.o
FAILED: tests/CMakeFiles/COLUMN_TEST.dir/column/column_view_device_span_test.cpp.o 
/usr/local/bin/g++ -DCUDF_VERSION=22.04.00 -DGTEST_LINKED_AS_SHARED_LIBRARY=1 -DJITIFY_USE_CACHE -DSPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_INFO -DTHRUST_DEVICE_SYSTEM=THRUST_DEVICE_SYSTEM_CUDA -DTHRUST_HOST_SYSTEM=THRUST_HOST_SYSTEM_CPP -I/cudf/cpp -I/cudf/cpp/src -I/cudf/cpp/build/_deps/dlpack-src/include -I/cudf/cpp/build/_deps/jitify-src -I/cudf/cpp/include -I/cudf/cpp/build/include -I/conda/envs/rapids/include/rapids/libcudacxx -I/cudf/cpp/build/_deps/thrust-src -I/cudf/cpp/build/_deps/thrust-src/dependencies/cub -isystem /conda/envs/rapids/include -isystem /usr/local/cuda/include -fdiagnostics-color=always -g -fPIE -Wall -Werror -Wno-unknown-pragmas -Wno-error=deprecated-declarations -Wno-deprecated-declarations -pthread -std=gnu++17 -MD -MT tests/CMakeFiles/COLUMN_TEST.dir/column/column_view_device_span_test.cpp.o -MF tests/CMakeFiles/COLUMN_TEST.dir/column/column_view_device_span_test.cpp.o.d -o tests/CMakeFiles/COLUMN_TEST.dir/column/column_view_device_span_test.cpp.o -c /cudf/cpp/tests/column/column_view_device_span_test.cpp
In file included from /cudf/cpp/include/cudf/column/column_view.hpp:19,
                 from /cudf/cpp/tests/column/column_view_device_span_test.cpp:17:
/cudf/cpp/include/cudf/column/column_view.hpp: In instantiation of ‘cudf::column_view::column_view(cudf::device_span<const T>) [with T = float; std::enable_if_t<(is_numeric<T>() || is_chrono<T>())>* <anonymous> = 0]’:
/cudf/cpp/tests/column/column_view_device_span_test.cpp:55:21:   required from ‘void ColumnViewDeviceSpanTests_conversion_round_trip_Test<gtest_TypeParam_>::TestBody() [with gtest_TypeParam_ = float]’
/cudf/cpp/tests/column/column_view_device_span_test.cpp:48:1:   required from here
/cudf/cpp/include/cudf/column/column_view.hpp:396:30: error: comparison of integer expressions of different signedness: ‘cudf::detail::span_base<const float, 18446744073709551615, cudf::device_span<const float> >::size_type’ {aka ‘long unsigned int’} and ‘int’ [-Werror=sign-compare]
  396 |     CUDF_EXPECTS(data.size() < std::numeric_limits<cudf::size_type>::max(),

The above also includes the command line compile that creates the error.
The solution implemented in this PR casts the size_type max() value to std::size_t before comparing it to the span's size() value.

The change implemented in #10302 introduced this conversion.

@davidwendt davidwendt added bug Something isn't working 3 - Ready for Review Ready for review by team libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change labels Feb 18, 2022
@davidwendt davidwendt requested a review from a team as a code owner February 18, 2022 19:52
@davidwendt davidwendt self-assigned this Feb 18, 2022
@codecov
Copy link

codecov bot commented Feb 18, 2022

Codecov Report

Merging #10331 (480b483) into branch-22.04 (a7d88cd) will increase coverage by 0.21%.
The diff coverage is n/a.

Impacted file tree graph

@@               Coverage Diff                @@
##           branch-22.04   #10331      +/-   ##
================================================
+ Coverage         10.42%   10.63%   +0.21%     
================================================
  Files               119      122       +3     
  Lines             20603    20940     +337     
================================================
+ Hits               2148     2228      +80     
- Misses            18455    18712     +257     
Impacted Files Coverage Δ
python/cudf/cudf/_fuzz_testing/fuzzer.py 0.00% <ø> (ø)
python/cudf/cudf/_fuzz_testing/io.py 0.00% <ø> (ø)
python/cudf/cudf/_fuzz_testing/main.py 0.00% <ø> (ø)
python/cudf/cudf/_version.py 0.00% <ø> (ø)
python/cudf/cudf/comm/gpuarrow.py 0.00% <ø> (ø)
python/cudf/cudf/core/_base_index.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/datetime.py 0.00% <ø> (ø)
python/cudf/cudf/core/column/methods.py 0.00% <ø> (ø)
... and 51 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 ec614ac...480b483. Read the comment docs.

@vyasr
Copy link
Contributor

vyasr commented Feb 19, 2022

@gpucibot merge

@rapids-bot rapids-bot bot merged commit 527d4ee into rapidsai:branch-22.04 Feb 19, 2022
@davidwendt davidwendt deleted the debug-column-view-span branch May 5, 2022 14:19
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 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.

4 participants