-
Notifications
You must be signed in to change notification settings - Fork 200
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
[REVIEW] cmake: handle thrust via target #579
Conversation
Can one of the admins verify this patch? |
1 similar comment
Can one of the admins verify this patch? |
ok to test |
That's its official name.
It would be best to use the Is there a reason that you want to avoid constructing a complete thrust interface target? |
Well, I guess it was the misguided idea of avoiding the trouble of having to pick a specific target, as in some sense, I'd prefer to let the user of RMM pick the specific configuration of Thrust they'd like to use (RMM itself doesn't really care that much, at least not for the host, though it definitely wants to use CUDA). But I think my plan leads to more problems than it solves ;( In any case, I opened NVIDIA/thrust#1295 which seems like the better place to discuss this. |
Trying to just use the internal Thrust::Thrust target bears trouble when trying to create a cmake config down the road, so this switches to the recommended way, that is, using `thrust_create_target()`, and naming it `rmm::Thrust` means one shouldn't run into naming conflicts even if RMM is used inside of another project. `FROM_OPTIONS` adds cmaeke cache variables `THRUST_HOST_SYSTEM` and `THRUST_DEVICE_SYSTEM` that allow overriding the default config if anyway needs to.
I agree with @allisonvacanti that using is My main concern was that if I make my own thrust target, and the downstream user of rmm also makes their own target, we could end up with two, possibly incompatibly configured thrust's. While this can't be prevented 100%, the the thrust cmake config does recognize when this happens and throws an error, so it's not going to cause subtle problems. |
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.
Hopefully we can move cuDF in this direction too...
This is just a relatively straightforward switch from adding the thrust include dir manually to using a target. This also
changes CPM to prefer an external thrust if it can be found.
I figured I'd use this to pull in @allisonvacanti to ask whether I'm misusing something by using the
Thrust::Thrust
target directly, rather than callingthrust_create_target()
. Since all I'm looking for is to get include path added, and RMM is clearly not designed for anything but CUDA, I'm hoping this is acceptable.There are more problems down the road, when it comes to installing RMM while it depends on either an internal or an external
thrust
. But let's leave that for next.