[clang] [CUDA][HIP] Fix std::is_invocable (PR #70369)
Yaxun Liu via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 26 19:58:27 PDT 2023
================
@@ -283,12 +283,18 @@ set(cuda_wrapper_files
cuda_wrappers/cmath
cuda_wrappers/complex
cuda_wrappers/new
+ cuda_wrappers/type_traits
)
set(cuda_wrapper_bits_files
cuda_wrappers/bits/shared_ptr_base.h
cuda_wrappers/bits/basic_string.h
cuda_wrappers/bits/basic_string.tcc
+ cuda_wrappers/bits/move.h
+)
+
+set(cuda_wrapper_utility_files
+ cuda_wrappers/__utility/swap.h
----------------
yxsamliu wrote:
well we got difficulty with MSVC.
[2023-10-27T02:08:50.900Z] In file included from <built-in>:1:
[2023-10-27T02:08:50.901Z] In file included from C:\Jenkins\workspace\compute-cpl-psdb\driver_build\drivers\compute\install\native\Release\x64\lc\lib\clang\18\include\__clang_hip_runtime_wrapper.h:143:
[2023-10-27T02:08:50.901Z] In file included from C:\Jenkins\workspace\compute-cpl-psdb\driver_build\drivers\compute\install\native\Release\x64\lc\lib\clang\18\include\__clang_hip_cmath.h:21:
[2023-10-27T02:08:50.901Z] C:/dk/win\vc\14.31.31107\include\utility:82:19: error: __host__ function 'swap' cannot overload __host__ __device__ function 'swap'
[2023-10-27T02:08:50.901Z] 82 | _CONSTEXPR20 void swap(_Ty (&_Left)[_Size], _Ty (&_Right)[_Size]) noexcept(_Is_nothrow_swappable<_Ty>::value) {
[2023-10-27T02:08:50.901Z] | ^
[2023-10-27T02:08:50.901Z] C:/dk/win\vc\14.31.31107\include\type_traits:1898:19: note: previous declaration is here
[2023-10-27T02:08:50.901Z] 1898 | _CONSTEXPR20 void swap(_Ty (&)[_Size], _Ty (&)[_Size]) noexcept(_Is_nothrow_swappable<_Ty>::value);
[2023-10-27T02:08:50.901Z] | ^
Basically <type_traits> declares swap, which becomes host device. But it is defined in <utility>. To avoid conflict, we have to wrap up <utility>. However, <utility> includes <concepts> and <compare>.
https://github.com/llvm/llvm-project/pull/70369
More information about the cfe-commits
mailing list