llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

HIPCC-5.7.0 misparsing types causing operator signed "ambiguous"

Open yizeyi18 opened this issue 2 years ago • 1 comments

While compiling dla-future(https://github.com/eth-cscs/DLA-Future/) with spack(https://github.com/spack/spack), an error like below encountered. It seems hipcc misparsed const HIP_vector_type<float, 2> as the same with hipFloatComplex(or say, float2, a struct in hip header), resulting in two possible '*' operator.

Shortened Error Message
/tmp/yizeyi18/spack-stage/spack-stage-dla-future-0.3.1-z3uclos3gvxaa7c5siuj7l7cx44yzj4k/spack-src/src/lapack/gpu/add.cu:32:17: error: use of overloaded operator '*' is ambiguous (with operand types 'const HIP_vector_type' and 'const HIP_vector_type')
  b = b + alpha * a;
          ~~~~~ ^ ~
/tmp/yizeyi18/spack-stage/spack-stage-dla-future-0.3.1-z3uclos3gvxaa7c5siuj7l7cx44yzj4k/spack-src/src/lapack/gpu/add.cu:101:30: note: in instantiation of function template specialization 'dlaf::gpulapack::kernels::addAlpha>' requested here
    addDiagInternal(m, n, alpha, a, lda, b, ldb);
                             ^
/tmp/yizeyi18/spack-stage/spack-stage-dla-future-0.3.1-z3uclos3gvxaa7c5siuj7l7cx44yzj4k/spack-src/src/lapack/gpu/add.cu:126:9: note: in instantiation of function template specialization 'dlaf::gpulapack::kernels::addDiag>' requested here
        addDiag<:util::islower>(m, n, alpha, a, lda, b, ldb);
        ^
/tmp/yizeyi18/spack-stage/spack-stage-dla-future-0.3.1-z3uclos3gvxaa7c5siuj7l7cx44yzj4k/spack-src/src/lapack/gpu/add.cu:161:12: note: in instantiation of function template specialization 'dlaf::gpulapack::kernels::add>' requested here
  kernels::add>>(util::blasToCublas(uplo), um, un,
           ^
/opt/rocm/include/hip/amd_detail/amd_hip_vector_types.h:548:65: note: candidate function
        friend __HOST_DEVICE__ inline constexpr HIP_vector_type operator*(
                                                                ^
/opt/rocm/include/hip/amd_detail/amd_hip_complex.h:237:1: note: candidate function
COMPLEX_MUL_OP_OVERLOAD(hipFloatComplex)
^
/opt/rocm/include/hip/amd_detail/amd_hip_complex.h:78:40: note: expanded from macro 'COMPLEX_MUL_OP_OVERLOAD'
    __HOST_DEVICE__ static inline type operator*(const type& lhs, const type& rhs) {           \

full build logs: logs_and_source.zip

yizeyi18 avatar Dec 07 '23 15:12 yizeyi18

@yizeyi18 Internal ticket has been created to investigate this issue. Thanks!

ppanchad-amd avatar Jul 29 '24 19:07 ppanchad-amd

Closing as I can't reproduce this with Ubuntu 22.04 + ROCm 6.2.2 on a 7900XTX, configuring spack with +rocm amdgpu_target=gfx1100 and specifying ROCm-packaged clang as the compiler. I did, however, have to remove the googletest version bump from the DLA-future/external makefile, as the cherry-pick was failing. If you're still experiencing this issue with current ROCm versions, feel free to comment and we can reopen this.

schung-amd avatar Oct 10 '24 13:10 schung-amd