CHIP-SPV / chipStar

chipStar is a tool for compiling and running HIP/CUDA on SPIR-V via OpenCL or Level Zero APIs.
Other
226 stars 34 forks source link

use of overloaded operator is ambiguous #647

Closed zjin-lcf closed 1 year ago

zjin-lcf commented 1 year ago

hipcc is from ROCm. Please see the following message.

hipcc hipComplex.cc (chipStar/samples/hipComplex)

hipComplex.cc:8:5: error: use of overloaded operator '*=' is ambiguous (with operand types 'hipDoubleComplex' (aka 'HIP_vector_type<double, 2>') and 'hipDoubleComplex')
  y *= x;
  ~ ^  ~
/opt/rocm-5.4.0/include/hip/amd_detail/amd_hip_vector_types.h:838:26: note: candidate function
        HIP_vector_type& operator*=(const HIP_vector_type& x) noexcept
zjin-lcf commented 1 year ago

Would you rewrite the operators as, for example, hipCmul(x,y) ?

Kerilk commented 1 year ago

@linehill Any idea why our sample would not compiler on rocm 5.4? Seems correct HP code to me.

linehill commented 1 year ago

It's most likely a bug in their headers. There is a same issue but for hipFloatComplex instead here: https://github.com/ROCm-Developer-Tools/HIP/issues/2797.

zjin-lcf commented 1 year ago

@Kerilk @linehill Thanks.