Add conversions between column_view and device_span<T const>.#10302
Merged
rapids-bot[bot] merged 18 commits intorapidsai:branch-22.04from Feb 17, 2022
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## branch-22.04 #10302 +/- ##
================================================
+ Coverage 10.42% 10.63% +0.21%
================================================
Files 119 122 +3
Lines 20603 20940 +337
================================================
+ Hits 2148 2228 +80
- Misses 18455 18712 +257
Continue to review full report at Codecov.
|
jrhemstad
reviewed
Feb 16, 2022
jrhemstad
reviewed
Feb 16, 2022
jrhemstad
reviewed
Feb 16, 2022
jrhemstad
reviewed
Feb 16, 2022
davidwendt
reviewed
Feb 17, 2022
Co-authored-by: David Wendt <45795991+davidwendt@users.noreply.github.com>
davidwendt
reviewed
Feb 17, 2022
davidwendt
reviewed
Feb 17, 2022
davidwendt
requested changes
Feb 17, 2022
Contributor
davidwendt
left a comment
There was a problem hiding this comment.
Could you add some gtests that exercise the CUDF_EXPECTS checks?
davidwendt
reviewed
Feb 17, 2022
jrhemstad
approved these changes
Feb 17, 2022
Contributor
Author
Yes, I think that's a good idea! I'll work on that. |
Co-authored-by: David Wendt <45795991+davidwendt@users.noreply.github.com>
davidwendt
approved these changes
Feb 17, 2022
Contributor
Author
|
@gpucibot merge |
rapids-bot bot
pushed a commit
that referenced
this pull request
Feb 19, 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. Authors: - David Wendt (https://github.com/davidwendt) Approvers: - Vukasin Milovanovic (https://github.com/vuule) - Nghia Truong (https://github.com/ttnghia) URL: #10331
This was referenced Jun 15, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds an implicit conversion operator from
column_viewtodevice_span<T const>. The immediate purpose of this PR is to make it possible to use the APIsegmented_reduce(column_view data, device_span<size_type> offsets, ...)in PR #9621.This PR also resolves #9656 by adding a
column_viewconstructor fromdevice_span<T const>.More broadly, this PR should make it easier to refactor instances where
column.data()is used with counting iterators to build transform iterators, or other patterns that require a length (e.g. vector factories to copy to host).