-
Notifications
You must be signed in to change notification settings - Fork 90
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] Make cuco compilable using clang #128
Comments
@MatthiasKohl Can you please specify how you build cuco with clang? Any particular version of clang you want to test with? |
@PointKernel Basically, I'd like to be able to build RAFT (rapids primitives) with clang, including the device code. This is to support tools like clang-tidy in RAFT, as well as getting better diagnostics in dependent projects. For RAPIDS, it would be great to support clang 11+, but if that's difficult for some reason, clang 13+ is good enough. EDIT: didn't mention this before: RAFT depends on cuCollections for some of its device code, although it's a small-ish part of RAFT. |
I can take care of this issue since I am also using clang tools in my dev pipeline. -> please assign me |
@sleeepyjack I started this adventure a while back but then got distracted. IIRC, the main blocking point was build failures in dependencies like |
Okay, maybe I was a bit too eager then 😆 However, I can take care of tracking the associated issues in the external projects and pinging the people in charge. I really don't want to miss out on |
@sleeepyjack Will ping you once I recall what I've done. |
@sleeepyjack in case you're interested, we have a script in Raft which turns nvcc/g++ compiler commands into clang++ commands, based on a cmake compilation command database. |
FYI, you quickly hit NVIDIA/cccl#1020 . |
In file included from cuda.cc:1: cuco/static_map.cuh:842:74: error: use 'template' keyword to treat 'rebind_alloc' as a dependent template name 842 | using slot_allocator_type = typename std::allocator_traits<Allocator>::rebind_alloc< | ^ This fixes the instances of this error I've hit so far. References: NVIDIA#128
```In file included from cuda.cc:1: cuco/static_map.cuh:842:74: error: use 'template' keyword to treat 'rebind_alloc' as a dependent template name 842 | using slot_allocator_type = typename std::allocator_traits<Allocator>::rebind_alloc< | ^ ``` This fixes the instances of this error I've hit so far. References: #128 --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
I'm now down to 1 error (at least when I try to include
I'm having trouble convincing myself if the following is going in the right direction, but it does fix the compiler error...
In
Which leads me to believe that the stanza in
I can write a small kernel which hits https://github.com/NVIDIA/cuCollections/blob/dev/include/cuco/pair.cuh#L103 but I can't hit https://github.com/NVIDIA/cuCollections/blob/dev/include/cuco/pair.cuh#L89
|
Is your feature request related to a problem? Please describe.
Any project dependent on cuco cannot be compiled using clang if the headers in cuco cannot be compiled using clang.
Describe the solution you'd like
It would be great if cuco has a check in place verifying that commits can be compiled using clang.
I'm currently setting something like this up for RAFT (see rapidsai/raft#424) so I'd be happy to provide something similar for cuco.
Additional context
In order to use something like
clang-tidy
, plus to get better compiler diagnostics, it's always good that code can be compiled using clang.A few specific things I ran into while applying the above mentioned PR to RAFT (all applies to git tag f0eecb203590f1f4ac4a9f1700229f4434ac64dc of this repo which RAFT depends on at the moment):
this->[[next/initial]]_slot
typename
keyword beforestatic_map
The text was updated successfully, but these errors were encountered: