Closed zingdle closed 3 years ago
FYI, Clang CUDA support in CUB is maintained by the community, we don't provide any guarantees or have CI for this compiler.
That said, the proposed fix sounds good to me. Could you submit a PR for this?
I've submitted a PR at https://github.com/NVIDIA/cub/pull/335 and PTAL.
Unfortunately this also breaks NVRTC :(
@benbarsdell Do you mean the patch breaks NVRTC? I have no experience with NVRTC but this->
is supported in NVCC. Does NVCC and NVRTC use different complie process?
Sorry for the confusion, the patch works in NVRTC. I just wanted to note that it's not just clang that doesn't like the old code.
When compiling
example/device/example_device_radix_sort.cu
withclang++-11 -DTHRUST_IGNORE_CUB_VERSION_CHECK -I../.. --cuda-gpu-arch=sm_61 -std=c++17 -x cuda -c example_device_radix_sort.cu
it errors:
clang
andgcc
use two phase name lookup sohttps://github.com/NVIDIA/cub/blob/1877cc09bb5292207fda082628c1eb59f76885e6/cub/block/radix_rank_sort_operations.cuh#L124
and
https://github.com/NVIDIA/cub/blob/1877cc09bb5292207fda082628c1eb59f76885e6/cub/block/radix_rank_sort_operations.cuh#L143
should use
this->ProcessFloatMinusZero(key)
But somehow
nvcc
accpet the follwing code: