-
Notifications
You must be signed in to change notification settings - Fork 156
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
Add CUDA device-callable projection API #1490
Add CUDA device-callable projection API #1490
Conversation
…in custom device code.
…ch is more public API friendly.
Compile error message in CUDA 12.6
Fixed by
|
Compiler error in CUDA 12.6
One solution
|
Compiler error with CUDA 12.6
One solution
|
In CUDA 12.6 there are many -Wshadow errors...
Solution left to reader :) |
Thanks @tmartin-gh ! I don't think we support CUDA 12.6 in RAPIDS yet.
The missing default: is a good catch, it should throw. WIll fix in this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like in theory, this device projection object also supports thrust transform using the device projection object as input. How about the following test?
TEST(ProjectionTest, device_readme_thrust_example)
{
using coordinate = cuproj::vec_2d<float>;
// Make a projection to convert WGS84 (lat, lon) coordinates to
// UTM zone 56S (x, y) coordinates
auto proj = cuproj::make_projection<coordinate>("EPSG:4326", "EPSG:32756");
rmm::cuda_stream_view stream = rmm::cuda_stream_default;
// Sydney, NSW, Australia
coordinate sydney{-33.858700, 151.214000};
thrust::device_vector<coordinate> d_in{1, sydney};
thrust::device_vector<coordinate> d_out(d_in.size());
auto d_proj = proj->get_device_projection(cuproj::direction::FORWARD);
thrust::transform(
rmm::exec_policy(stream), d_in.begin(), d_in.end(), d_out.begin(), d_proj
);
}
After investigation, |
But is this test necessary? After all this is exactly the implementation of
|
FWIW MatX turns this warning on. https://github.com/NVIDIA/MatX/blob/0e5c634ee29f7e5a60802d34afbeadab6dac4e35/CMakeLists.txt#L145 |
@tmartin-gh I have fixed all the errors you found except the |
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
You are right about this. Resolved! |
Looks good. Approved. |
/merge |
Description
Closes #1489
This PR refactors device
cuspatial::detail::pipeline
into the public API via a type aliascuspatial::device_projection
which can be passed to a CUDA kernel and invoked to transform coordinates.cuspatial::projection::get_device_projection(direction)
can be used to get adevice_projection
.This required changing the direction parameter for
cuspatial::detail::pipeline
to a constructor parameter rather than a template parameter. I benchmarked before and after this change and saw no significant difference.I have added tests and an example in
README.txt
.Checklist