Skip to content

Commit 6025190

Browse files
committed
add half/bfloat guard
1 parent 6813780 commit 6025190

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

libcudacxx/include/cuda/__type_traits/is_trivially_copyable.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,20 @@ inline constexpr bool __is_trivially_copyable_v<::cuda::std::complex<::__half>>
7272
template <>
7373
inline constexpr bool __is_trivially_copyable_v<::cuda::std::complex<::__nv_bfloat16>> = true;
7474

75+
#if _CCCL_HAS_NVFP16()
76+
7577
template <>
7678
inline constexpr bool __is_trivially_copyable_v<::cuda::complex<::__half>> = true;
7779

80+
#endif // _CCCL_HAS_NVFP16
81+
82+
#if _CCCL_HAS_NVBF16()
83+
7884
template <>
7985
inline constexpr bool __is_trivially_copyable_v<::cuda::complex<::__nv_bfloat16>> = true;
8086

87+
#endif // _CCCL_HAS_NVBF16
88+
8189
// if all the previous conditions fail, check if the type is an aggregate and all its members are trivially copyable
8290
template <typename _Tp>
8391
using __is_trivially_copyable_callable = ::cuda::std::bool_constant<__is_trivially_copyable_v<_Tp>>;

0 commit comments

Comments
 (0)