I am compiling CUDA program using LLVM@14.0.0 and the CUDA backend is CUDA@11.5.0. I want to use the new feature of contolling L2 cache via annotated pointer, but it seems that clang doesn’t support it well.
In file included from L2_stream_binding.cu:5:
In file included from /data/home/mzw/spack/opt/spack/linux-centos7-zen/gcc-7.5.0/cuda-11.5.0-m5vnfghinm5zygqtqh2s6uxvnbvo4wht/bin/../targets/x86_64-linux/include/cuda/annotated_ptr:58:
In file included from /data/home/mzw/spack/opt/spack/linux-centos7-zen/gcc-7.5.0/cuda-11.5.0-m5vnfghinm5zygqtqh2s6uxvnbvo4wht/bin/../targets/x86_64-linux/include/cuda/barrier:10:
In file included from /data/home/mzw/spack/opt/spack/linux-centos7-zen/gcc-7.5.0/cuda-11.5.0-m5vnfghinm5zygqtqh2s6uxvnbvo4wht/bin/../targets/x86_64-linux/include/cuda/std/barrier:17:
In file included from /data/home/mzw/spack/opt/spack/linux-centos7-zen/gcc-7.5.0/cuda-11.5.0-m5vnfghinm5zygqtqh2s6uxvnbvo4wht/bin/../targets/x86_64-linux/include/cuda/std/atomic:41:
In file included from /data/home/mzw/spack/opt/spack/linux-centos7-zen/gcc-7.5.0/cuda-11.5.0-m5vnfghinm5zygqtqh2s6uxvnbvo4wht/bin/../targets/x86_64-linux/include/cuda/std/cstddef:35:
In file included from /data/home/mzw/spack/opt/spack/linux-centos7-zen/gcc-7.5.0/cuda-11.5.0-m5vnfghinm5zygqtqh2s6uxvnbvo4wht/bin/../targets/x86_64-linux/include/cuda/std/type_traits:24:
/data/home/mzw/spack/opt/spack/linux-centos7-zen/gcc-7.5.0/cuda-11.5.0-m5vnfghinm5zygqtqh2s6uxvnbvo4wht/bin/../targets/x86_64-linux/include/cuda/std/detail/libcxx/include/type_traits:520:12: error: CUDA device code does not support variadic functions
false_type __sfinae_test_impl(...);
^
/data/home/mzw/spack/opt/spack/linux-centos7-zen/gcc-7.5.0/cuda-11.5.0-m5vnfghinm5zygqtqh2s6uxvnbvo4wht/bin/../targets/x86_64-linux/include/cuda/std/detail/libcxx/include/type_traits:1059:69: error: CUDA device code does not support variadic functions
template <class _Tp> _LIBCUDACXX_INLINE_VISIBILITY static __two __test(...);
^
/data/home/mzw/spack/opt/spack/linux-centos7-zen/gcc-7.5.0/cuda-11.5.0-m5vnfghinm5zygqtqh2s6uxvnbvo4wht/bin/../targets/x86_64-linux/include/cuda/std/detail/libcxx/include/type_traits:1171:5: error: CUDA device code does not support variadic functions
__any(...);
^
/data/home/mzw/spack/opt/spack/linux-centos7-zen/gcc-7.5.0/cuda-11.5.0-m5vnfghinm5zygqtqh2s6uxvnbvo4wht/bin/../targets/x86_64-linux/include/cuda/std/detail/libcxx/include/type_traits:1848:16: error: CUDA device code does not support variadic functions
static void __test(...);
^
/data/home/mzw/spack/opt/spack/linux-centos7-zen/gcc-7.5.0/cuda-11.5.0-m5vnfghinm5zygqtqh2s6uxvnbvo4wht/bin/../targets/x86_64-linux/include/cuda/std/detail/libcxx/include/type_traits:2272:18: error: CUDA device code does not support variadic functions
static __two __test (...);
^
/data/home/mzw/spack/opt/spack/linux-centos7-zen/gcc-7.5.0/cuda-11.5.0-m5vnfghinm5zygqtqh2s6uxvnbvo4wht/bin/../targets/x86_64-linux/include/cuda/std/detail/libcxx/include/type_traits:4332:16: error: CUDA device code does not support variadic functions
static __nat __try_call(...);
^
In file included from L2_stream_binding.cu:5:
In file included from /data/home/mzw/spack/opt/spack/linux-centos7-zen/gcc-7.5.0/cuda-11.5.0-m5vnfghinm5zygqtqh2s6uxvnbvo4wht/bin/../targets/x86_64-linux/include/cuda/annotated_ptr:58:
In file included from /data/home/mzw/spack/opt/spack/linux-centos7-zen/gcc-7.5.0/cuda-11.5.0-m5vnfghinm5zygqtqh2s6uxvnbvo4wht/bin/../targets/x86_64-linux/include/cuda/barrier:10:
In file included from /data/home/mzw/spack/opt/spack/linux-centos7-zen/gcc-7.5.0/cuda-11.5.0-m5vnfghinm5zygqtqh2s6uxvnbvo4wht/bin/../targets/x86_64-linux/include/cuda/std/barrier:17:
/data/home/mzw/spack/opt/spack/linux-centos7-zen/gcc-7.5.0/cuda-11.5.0-m5vnfghinm5zygqtqh2s6uxvnbvo4wht/bin/../targets/x86_64-linux/include/cuda/std/atomic:56:22: error: no member named 'thread_scope' in namespace 'cuda::std::__detail'
using std::__detail::thread_scope;
~~~~~~~~~~~~~~~^
/data/home/mzw/spack/opt/spack/linux-centos7-zen/gcc-7.5.0/cuda-11.5.0-m5vnfghinm5zygqtqh2s6uxvnbvo4wht/bin/../targets/x86_64-linux/include/cuda/std/atomic:57:22: error: no member named 'thread_scope_system' in namespace 'cuda::std::__detail'
using std::__detail::thread_scope_system;
~~~~~~~~~~~~~~~^
/data/home/mzw/spack/opt/spack/linux-centos7-zen/gcc-7.5.0/cuda-11.5.0-m5vnfghinm5zygqtqh2s6uxvnbvo4wht/bin/../targets/x86_64-linux/include/cuda/std/atomic:58:22: error: no member named 'thread_scope_device' in namespace 'cuda::std::__detail'
using std::__detail::thread_scope_device;
~~~~~~~~~~~~~~~^
/data/home/mzw/spack/opt/spack/linux-centos7-zen/gcc-7.5.0/cuda-11.5.0-m5vnfghinm5zygqtqh2s6uxvnbvo4wht/bin/../targets/x86_64-linux/include/cuda/std/atomic:59:22: error: no member named 'thread_scope_block' in namespace 'cuda::std::__detail'
using std::__detail::thread_scope_block;
~~~~~~~~~~~~~~~^
/data/home/mzw/spack/opt/spack/linux-centos7-zen/gcc-7.5.0/cuda-11.5.0-m5vnfghinm5zygqtqh2s6uxvnbvo4wht/bin/../targets/x86_64-linux/include/cuda/std/atomic:60:22: error: no member named 'thread_scope_thread' in namespace 'cuda::std::__detail'
using std::__detail::thread_scope_thread;
~~~~~~~~~~~~~~~^
/data/home/mzw/spack/opt/spack/linux-centos7-zen/gcc-7.5.0/cuda-11.5.0-m5vnfghinm5zygqtqh2s6uxvnbvo4wht/bin/../targets/x86_64-linux/include/cuda/std/atomic:63:22: error: no member named '__thread_scope_block_tag' in namespace 'cuda::std::__detail'
using std::__detail::__thread_scope_block_tag;
~~~~~~~~~~~~~~~^
/data/home/mzw/spack/opt/spack/linux-centos7-zen/gcc-7.5.0/cuda-11.5.0-m5vnfghinm5zygqtqh2s6uxvnbvo4wht/bin/../targets/x86_64-linux/include/cuda/std/atomic:64:22: error: no member named '__thread_scope_device_tag' in namespace 'cuda::std::__detail'
using std::__detail::__thread_scope_device_tag;
~~~~~~~~~~~~~~~^
/data/home/mzw/spack/opt/spack/linux-centos7-zen/gcc-7.5.0/cuda-11.5.0-m5vnfghinm5zygqtqh2s6uxvnbvo4wht/bin/../targets/x86_64-linux/include/cuda/std/atomic:65:22: error: no member named '__thread_scope_system_tag' in namespace 'cuda::std::__detail'
using std::__detail::__thread_scope_system_tag;
~~~~~~~~~~~~~~~^
/data/home/mzw/spack/opt/spack/linux-centos7-zen/gcc-7.5.0/cuda-11.5.0-m5vnfghinm5zygqtqh2s6uxvnbvo4wht/bin/../targets/x86_64-linux/include/cuda/std/atomic:66:7: error: no member named '__atomic_signal_fence_cuda' in namespace 'cuda::std::__detail'; did you mean '::__atomic_signal_fence'?
using std::__detail::__atomic_signal_fence_cuda;
^~~~~~~~~~~~~~~
/data/home/mzw/spack/opt/spack/linux-centos7-x86_64_v3/gcc-4.8.5/gcc-7.5.0-575nvplvtbr5fqwbmtzwhz537i3k3cty/lib/gcc/x86_64-pc-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/atomic_base.h:106:5: note: '::__atomic_signal_fence' declared here
{ __atomic_signal_fence(__m); }
^
In file included from L2_stream_binding.cu:5:
In file included from /data/home/mzw/spack/opt/spack/linux-centos7-zen/gcc-7.5.0/cuda-11.5.0-m5vnfghinm5zygqtqh2s6uxvnbvo4wht/bin/../targets/x86_64-linux/include/cuda/annotated_ptr:58:
In file included from /data/home/mzw/spack/opt/spack/linux-centos7-zen/gcc-7.5.0/cuda-11.5.0-m5vnfghinm5zygqtqh2s6uxvnbvo4wht/bin/../targets/x86_64-linux/include/cuda/barrier:10:
In file included from /data/home/mzw/spack/opt/spack/linux-centos7-zen/gcc-7.5.0/cuda-11.5.0-m5vnfghinm5zygqtqh2s6uxvnbvo4wht/bin/../targets/x86_64-linux/include/cuda/std/barrier:17:
/data/home/mzw/spack/opt/spack/linux-centos7-zen/gcc-7.5.0/cuda-11.5.0-m5vnfghinm5zygqtqh2s6uxvnbvo4wht/bin/../targets/x86_64-linux/include/cuda/std/atomic:67:7: error: no member named '__atomic_thread_fence_cuda' in namespace 'cuda::std::__detail'; did you mean '::__atomic_thread_fence'?
using std::__detail::__atomic_thread_fence_cuda;
^~~~~~~~~~~~~~~
/data/home/mzw/spack/opt/spack/linux-centos7-x86_64_v3/gcc-4.8.5/gcc-7.5.0-575nvplvtbr5fqwbmtzwhz537i3k3cty/lib/gcc/x86_64-pc-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/atomic_base.h:102:5: note: '::__atomic_thread_fence' declared here
{ __atomic_thread_fence(__m); }
^
In file included from L2_stream_binding.cu:5:
In file included from /data/home/mzw/spack/opt/spack/linux-centos7-zen/gcc-7.5.0/cuda-11.5.0-m5vnfghinm5zygqtqh2s6uxvnbvo4wht/bin/../targets/x86_64-linux/include/cuda/annotated_ptr:58:
In file included from /data/home/mzw/spack/opt/spack/linux-centos7-zen/gcc-7.5.0/cuda-11.5.0-m5vnfghinm5zygqtqh2s6uxvnbvo4wht/bin/../targets/x86_64-linux/include/cuda/barrier:10:
In file included from /data/home/mzw/spack/opt/spack/linux-centos7-zen/gcc-7.5.0/cuda-11.5.0-m5vnfghinm5zygqtqh2s6uxvnbvo4wht/bin/../targets/x86_64-linux/include/cuda/std/barrier:17:
/data/home/mzw/spack/opt/spack/linux-centos7-zen/gcc-7.5.0/cuda-11.5.0-m5vnfghinm5zygqtqh2s6uxvnbvo4wht/bin/../targets/x86_64-linux/include/cuda/std/atomic:81:22: error: unknown type name 'thread_scope'
template <class _Tp, thread_scope _Sco = thread_scope::thread_scope_system>
^
/data/home/mzw/spack/opt/spack/linux-centos7-zen/gcc-7.5.0/cuda-11.5.0-m5vnfghinm5zygqtqh2s6uxvnbvo4wht/bin/../targets/x86_64-linux/include/cuda/std/atomic:81:42: error: use of undeclared identifier 'thread_scope'
template <class _Tp, thread_scope _Sco = thread_scope::thread_scope_system>
^
/data/home/mzw/spack/opt/spack/linux-centos7-zen/gcc-7.5.0/cuda-11.5.0-m5vnfghinm5zygqtqh2s6uxvnbvo4wht/bin/../targets/x86_64-linux/include/cuda/std/atomic:101:16: error: no member named '__cxx_atomic_fetch_max' in namespace 'cuda::std::__detail'; did you mean '__c11_atomic_fetch_max'?
return std::__detail::__cxx_atomic_fetch_max(&this->__a_, __op, __m);
^~~~~~~~~~~~~~~
/data/home/mzw/spack/opt/spack/linux-centos7-zen/gcc-7.5.0/cuda-11.5.0-m5vnfghinm5zygqtqh2s6uxvnbvo4wht/bin/../targets/x86_64-linux/include/cuda/std/atomic:101:31: note: '__c11_atomic_fetch_max' declared here
return std::__detail::__cxx_atomic_fetch_max(&this->__a_, __op, __m);
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
If I use nvcc, everything goes well. So, I guess it’s the problem of Clang. How to work around it? Thank you!