HIP
HIP copied to clipboard
Built-in vector types float2, float3 and float4 are not trivially copyable
float2
, float3
and float4
are trivially copyable in CUDA, but they are not in HIP.
This results in the following piece of code working in CUDA, but failing in HIP:
static_assert(std::is_trivially_copyable_v<float2>);
It transitively applies to any class that uses such a data member as well.
This seems due to the assignment operator and similar ones:
https://github.com/ROCm-Developer-Tools/hipamd/blob/rocm-5.1.x/include/hip/amd_detail/amd_hip_vector_types.h#L487
data
is builtin vector type for clang and array type for GCC. It seems to me in either case the default assignment operator should work.