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

Refactor lonlat_to_cartesian to header-only API #514

Merged

Conversation

harrism
Copy link
Member

@harrism harrism commented Apr 7, 2022

Following #477, implements the header-only API for cuspatial::lonlat_to_cartesian and implements existing C++ API on top of it.

Follows the refactoring guide introduced in #477.

Note this branch is based on the branch for #477 so diff includes all changes from that PR as well. Once #477 is merged this PR will simplify a lot.

harrism and others added 30 commits January 19, 2022 15:19
Co-authored-by: Jake Hemstad <jhemstad@nvidia.com>
Co-authored-by: Paul Taylor <paul.e.taylor@me.com>
@harrism harrism added the 3 - Ready for Review Ready for review by team label Apr 28, 2022
Copy link
Contributor

@vyasr vyasr left a comment

Choose a reason for hiding this comment

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

CMake LGTM

@harrism harrism requested review from trxcllnt and removed request for jrhemstad May 2, 2022 22:16
CUSPATIAL_EXPECTS(origin.x >= -180 && origin.x <= 180 && origin.y >= -90 && origin.y <= 90,
"origin must have valid longitude [-180, 180] and latitude [-90, 90]");

return thrust::transform(rmm::exec_policy(stream),
Copy link
Contributor

@isVoid isVoid May 5, 2022

Choose a reason for hiding this comment

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

I was wondering, for methods that does not fit into the transform framework (e.g. linestring instance kernel that launches on num_points and writes to num_segments output), what's the STL convention to follow? cc @jrhemstad

Copy link
Contributor

Choose a reason for hiding this comment

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

What exactly at your looking for? An example of an algorithm that operates on N inputs and produces M outputs where N != M?

Stream compaction algorithms like copy_if are one example ( M <= N).

Offhand I can't think of algorithms where M >= N. Maybe set_union?

@codereport would be the real guru to ask here.

Copy link
Contributor

@isVoid isVoid May 5, 2022

Choose a reason for hiding this comment

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

For pairwise linestring distance the input the data structure is segmented, and each pair of segments (non-geometric meaning) map to a single value. It's like segmented reduction with two value input iterators.

Copy link
Contributor

Choose a reason for hiding this comment

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

@isVoid Do you mean two elements at a time are mapped to a single value? Something like this:

Prelude> [1..10]                        -- [1,2,3,4,5,6,7,8,9,10]
Prelude> chunksOf 2 [1..10]             -- [[1,2],[3,4],[5,6],[7,8],[9,10]]
Prelude> map sum . chunksOf 2 $ [1..10] -- [3,7,11,15,19]

Copy link
Member Author

Choose a reason for hiding this comment

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

@codereport no. Two separate segmented input arrays. Equal number of segments in the two arrays, but corresponding segments need not have the same length. Apply an operator to corresponding pairs of segments.

Copy link
Contributor

@isVoid isVoid left a comment

Choose a reason for hiding this comment

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

I think it looks good. Just one small question above.

@harrism
Copy link
Member Author

harrism commented May 26, 2022

rerun tests

@harrism
Copy link
Member Author

harrism commented Jun 1, 2022

@gpucibot merge

@rapids-bot rapids-bot bot merged commit 01702a7 into rapidsai:branch-22.06 Jun 1, 2022
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 cmake Related to CMake code or build configuration feature request New feature or request libcuspatial Relates to the cuSpatial C++ library non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants