[FEA] Consistently use the same convention for hpp
files and their usage of device APIs
#2064
Labels
feature request
New feature or request
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 safehpp
files that would only include cuda symbols in the event thatnvcc
was compiling the files. The problem is that we have not been consistently using this same convention and it's been causing somehpp
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 couplecuh
extension files being included inraft/core
but yet we haveoperators.cuh
andmdbuffer.cuh
(ref #1999). Whichever path we choose, we need to use it consistently. Thus far, it seems to be mostly themath.hpp
which is breaking this rule, however I personally rather like the convention of having an hpp file that immediately includes thecuh
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.
The text was updated successfully, but these errors were encountered: