rapids-cmake icon indicating copy to clipboard operation
rapids-cmake copied to clipboard

Make `rapids_cpm_cccl()` disable CUB detail namespace

Open trxcllnt opened this issue 1 year ago • 2 comments

Description

Define CUB_DISABLE_NAMESPACE_MAGIC and CUB_IGNORE_NAMESPACE_MAGIC_ERROR so CUB doesn't include the __CUDA_ARCH_LIST__ in its ABI.

Checklist

  • [x] I am familiar with the Contributing Guidelines.
  • [ ] New or existing tests cover these changes.
  • [ ] The documentation is up to date with these changes.
  • [ ] The cmake-format.json is up to date with these changes.
  • [ ] I have added new files under rapids-cmake/
    • [ ] I have added include guards (include_guard(GLOBAL))
    • [ ] I have added the associated docs/ rst file and update the api.rst

trxcllnt avatar Aug 13 '24 20:08 trxcllnt

@robertmaynard can you take a look here? I've lost track of what decisions we've made where about keeping or removing this particular ABI mangling. I know it's caused headaches with differences between host and device compilation of the same headers.

vyasr avatar Aug 19 '24 22:08 vyasr

We know that for sure that projects the build with -fvisibility=hidden will have no impact since the CUB mangling is a fix for clashes in the global symbol table lookup.

My major concern is that by fully disabling the CUB detail magic logic we also drop the CUB_VERSION from the namespace name. That I think is important as it means that we could clash with DSO built with older ( 1.X ) versions of CUB which didn't have any name mangling. This issue currently exists with the Thrust types but we sorta ignore it for now.

In a perfect world we could tell CCCL to drop the CUDA_ARCH mangling but leave the VERSION mangling. That would give us reproducible builds and also ensure we don't clash at runtime

robertmaynard avatar Aug 20 '24 16:08 robertmaynard

@trxcllnt Going to close this as no work has occurred in the last two releases

robertmaynard avatar Jan 21 '25 15:01 robertmaynard