[llvm-bugs] [Bug 51757] New: Clang-12 cannot compile CUB and Thrust libraries in CUDA 11.4.1

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Sep 5 11:23:58 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=51757

            Bug ID: 51757
           Summary: Clang-12 cannot compile CUB and Thrust libraries in
                    CUDA 11.4.1
           Product: clang
           Version: 12.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: serge.rogatch at gmail.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

When #include <cub/cub.cuh> or #include <thrust/copy.h> is present in a CUDA
source file compiled with clang-12 with CUDA Toolkit 11.4.1, compilation errors
appear as in
https://stackoverflow.com/questions/69064115/compilation-of-cub-library-with-clang-as-the-cuda-compiler
and also the following error for `thrust`:

In file included from /usr/local/cuda-11.4/include/thrust/copy.h:512:
In file included from /usr/local/cuda-11.4/include/thrust/detail/copy_if.h:74:
In file included from
/usr/local/cuda-11.4/include/thrust/detail/copy_if.inl:20:
In file included from
/usr/local/cuda-11.4/include/thrust/system/detail/generic/copy_if.h:63:
In file included from
/usr/local/cuda-11.4/include/thrust/system/detail/generic/copy_if.inl:31:
In file included from /usr/local/cuda-11.4/include/thrust/scan.h:1563:
In file included from /usr/local/cuda-11.4/include/thrust/detail/scan.inl:29:
In file included from
/usr/local/cuda-11.4/include/thrust/system/detail/adl/scan_by_key.h:42:
In file included from
/usr/local/cuda-11.4/include/thrust/system/cuda/detail/scan_by_key.h:34:
In file included from
/usr/local/cuda-11.4/include/thrust/system/cuda/execution_policy.h:51:
In file included from
/usr/local/cuda-11.4/include/thrust/system/cuda/detail/partition.h:42:
In file included from /usr/local/cuda-11.4/include/thrust/partition.h:1438:
In file included from
/usr/local/cuda-11.4/include/thrust/detail/partition.inl:26:
In file included from
/usr/local/cuda-11.4/include/thrust/system/detail/generic/partition.h:169:
In file included from
/usr/local/cuda-11.4/include/thrust/system/detail/generic/partition.inl:26:
In file included from /usr/local/cuda-11.4/include/thrust/sort.h:1361:
In file included from /usr/local/cuda-11.4/include/thrust/detail/sort.inl:27:
In file included from
/usr/local/cuda-11.4/include/thrust/system/detail/adl/sort.h:42:
In file included from
/usr/local/cuda-11.4/include/thrust/system/cuda/detail/sort.h:36:
In file included from
/usr/local/cuda-11.4/include/cub/device/device_radix_sort.cuh:40:
In file included from
/usr/local/cuda-11.4/include/cub/device/dispatch/dispatch_radix_sort.cuh:40:
In file included from
/usr/local/cuda-11.4/include/cub/device/dispatch/../../agent/agent_radix_sort_histogram.cuh:38:
/usr/local/cuda-11.4/include/cub/block/radix_rank_sort_operations.cuh:124:20:
error: explicit qualification required to use member 'ProcessFloatMinusZero'
from dependent base class
        return BFE(ProcessFloatMinusZero(key), bit_start, num_bits);
                   ^
/usr/local/cuda-11.4/include/cub/block/block_radix_rank.cuh:413:50: note: in
instantiation of member function 'cub::BFEDigitExtractor<unsigned int>::Digit'
requested here
            unsigned int digit = digit_extractor.Digit(keys[ITEM]);
                                                 ^
/usr/local/cuda-11.4/include/cub/device/dispatch/../../block/block_radix_sort.cuh:228:72:
note: in instantiation of function template specialization
'cub::BlockRadixRank<256, 6, false, true, cub::BLOCK_SCAN_WARP_SCANS,
cudaSharedMemBankSizeFourByte, 1, 1, 750>::RankKeys<unsigned int, 19,
cub::BFEDigitExtractor<unsigned int>>' requested here
       
AscendingBlockRadixRank(temp_storage.asending_ranking_storage).RankKeys(
                                                                       ^
/usr/local/cuda-11.4/include/cub/device/dispatch/../../block/block_radix_sort.cuh:367:13:
note: in instantiation of member function 'cub::BlockRadixSort<unsigned int,
256, 19, unsigned int, 6, true, cub::BLOCK_SCAN_WARP_SCANS,
cudaSharedMemBankSizeFourByte, 1, 1, 750>::RankKeys' requested here
            RankKeys(unsigned_keys, ranks, digit_extractor, is_descending);
            ^
/usr/local/cuda-11.4/include/cub/device/dispatch/dispatch_radix_sort.cuh:327:40:
note: in instantiation of function template specialization
'cub::BlockRadixSort<unsigned int, 256, 19, unsigned int, 6, true,
cub::BLOCK_SCAN_WARP_SCANS, cudaSharedMemBankSizeFourByte, 1, 1,
750>::SortBlockedToStriped<0, 0>' requested here
    BlockRadixSortT(temp_storage.sort).SortBlockedToStriped(
                                       ^
/usr/local/cuda-11.4/include/cub/device/dispatch/dispatch_radix_sort.cuh:1562:17:
note: in instantiation of function template specialization
'cub::DeviceRadixSortSingleTileKernel<cub::DeviceRadixSortPolicy<unsigned int,
unsigned int, int>::Policy800, false, unsigned int, unsigned int, int>'
requested here
                DeviceRadixSortSingleTileKernel<MaxPolicyT, IS_DESCENDING,
KeyT, ValueT, OffsetT>);
                ^
/usr/local/cuda-11.4/include/cub/device/dispatch/../../util_device.cuh:706:28:
note: (skipping 12 contexts in backtrace; use -ftemplate-backtrace-limit=0 to
see all)
        return op.template Invoke<PolicyT>();
                           ^
/usr/local/cuda-11.4/include/thrust/system/cuda/detail/sort.h:1672:19: note: in
instantiation of function template specialization
'thrust::cuda_cub::__smart_sort::smart_sort<thrust::detail::integral_constant<bool,
true>, thrust::detail::integral_constant<bool, false>, thrust::cuda_cub::tag,
thrust::detail::normal_iterator<thrust::device_ptr<unsigned int>>,
thrust::detail::normal_iterator<thrust::device_ptr<unsigned int>>,
thrust::less<unsigned int>>' requested here
    __smart_sort::smart_sort<thrust::detail::true_type,
thrust::detail::false_type>(
                  ^
/usr/local/cuda-11.4/include/thrust/system/cuda/detail/sort.h:1740:13: note: in
instantiation of function template specialization
'thrust::cuda_cub::sort_by_key<thrust::cuda_cub::tag,
thrust::detail::normal_iterator<thrust::device_ptr<unsigned int>>,
thrust::detail::normal_iterator<thrust::device_ptr<unsigned int>>,
thrust::less<unsigned int>>' requested here
  cuda_cub::sort_by_key(policy, keys_first, keys_last, values,
less<key_type>());
            ^
/usr/local/cuda-11.4/include/thrust/detail/sort.inl:98:10: note: in
instantiation of function template specialization
'thrust::cuda_cub::sort_by_key<thrust::cuda_cub::tag,
thrust::detail::normal_iterator<thrust::device_ptr<unsigned int>>,
thrust::detail::normal_iterator<thrust::device_ptr<unsigned int>>>' requested
here
  return
sort_by_key(thrust::detail::derived_cast(thrust::detail::strip_const(exec)),
keys_first, keys_last, values_first);
         ^
/usr/local/cuda-11.4/include/thrust/detail/sort.inl:285:18: note: in
instantiation of function template specialization
'thrust::sort_by_key<thrust::cuda_cub::tag,
thrust::detail::normal_iterator<thrust::device_ptr<unsigned int>>,
thrust::detail::normal_iterator<thrust::device_ptr<unsigned int>>>' requested
here
  return thrust::sort_by_key(select_system(system1,system2), keys_first,
keys_last, values_first);
                 ^
some_source.cu:2659:3: note: in instantiation of function template
specialization
'thrust::sort_by_key<thrust::detail::normal_iterator<thrust::device_ptr<unsigned
int>>, thrust::detail::normal_iterator<thrust::device_ptr<unsigned int>>>'
requested here
  sort_by_key(key.begin(), key.begin() + size, val.begin());
  ^
/usr/local/cuda-11.4/include/cub/block/radix_rank_sort_operations.cuh:98:52:
note: member is declared here
    static __device__ __forceinline__ UnsignedBits
ProcessFloatMinusZero(UnsignedBits key)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210905/dc149a88/attachment-0001.html>


More information about the llvm-bugs mailing list