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

[FEA] Consistently use the same convention for hpp files and their usage of device APIs #2064

Open
cjnolet opened this issue Dec 15, 2023 · 0 comments
Labels
feature request New feature or request

Comments

@cjnolet
Copy link
Member

cjnolet commented Dec 15, 2023

At one point (early days of cuml), we made the convention that all device symbols would be separated into their own cuh files. However, over the years we have started making safe hpp files that would only include cuda symbols in the event that nvcc was compiling the files. The problem is that we have not been consistently using this same convention and it's been causing some hpp headers for the core vocabulary types to end up including device symbols while others don't.

Take math.hpp, which marks functions as device when compiling with nvcc.

And also take operators.cuh which includes the device functions so that they aren't included in operators.hpp (though operators.hpp includes math.hpp)!

In addition, we now have bitset.cuh, which is one of only a couple cuh extension files being included in raft/core but yet we have operators.cuh and mdbuffer.cuh (ref #1999). Whichever path we choose, we need to use it consistently. Thus far, it seems to be mostly the math.hpp which is breaking this rule, however I personally rather like the convention of having an hpp file that immediately includes the cuh file (which excludes the device symbols) to make it explicit and obvious to users.

We just need to pick a path and stick with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
Status: In Progress
Development

No branches or pull requests

1 participant