<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Clang-12 cannot compile CUB and Thrust libraries in CUDA 11.4.1"
   href="https://bugs.llvm.org/show_bug.cgi?id=51757">51757</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang-12 cannot compile CUB and Thrust libraries in CUDA 11.4.1
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>12.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>-New Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>serge.rogatch@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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
<a href="https://stackoverflow.com/questions/69064115/compilation-of-cub-library-with-clang-as-the-cuda-compiler">https://stackoverflow.com/questions/69064115/compilation-of-cub-library-with-clang-as-the-cuda-compiler</a>
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)</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>