Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hipBLAS's complex number definition causes compilation failures #135

Closed
cadebrown opened this issue Dec 23, 2019 · 3 comments
Closed

hipBLAS's complex number definition causes compilation failures #135

cadebrown opened this issue Dec 23, 2019 · 3 comments

Comments

@cadebrown
Copy link

cadebrown commented Dec 23, 2019

What is the expected behavior

  • hipBLAS doesn't redefine HIP complex number implementation, and simply uses hip_complex.h to provide hipFloatComplex & hipDoubleComplex

What actually happens

  • hipBLAS redefines HIP complex number definitions in a contradictory way which causes compilation failures

How to reproduce

  • Simply include hipblas.h and hip/hip_complex.h in any project:
/// test.cpp
#include <hipblas.h>
#include <hip/hip_complex.h>

hipcc test.cpp errors

Environment

Software version
HCC 3.0.19493-75ea952e-40756364719e

Why does the hipBLAS library define complex numbers in a way which is incompatible with the rest of HIP?

There are far too many errors for even an example program. The first error is:

/opt/rocm/include/hipblas.h:53:36: error: typedef redefinition with different types ('hip_complex_number<float>' vs 'hipFloatComplex' (aka 'HIP_vector_type<float, 2>'))
typedef hip_complex_number<float>  hipComplex;
                                   ^
/opt/rocm/hip/include/hip/hcc_detail/hip_complex.h:269:25: note: previous definition is here
typedef hipFloatComplex hipComplex;
                        ^

It seems the lines are: https://github.com/ROCmSoftwarePlatform/hipBLAS/tree/develop/library/include#L53

Is there a reason why hipBLAS could not use the HIP standard complex number definition? Or is there some workaround to be able to use both at the same time?

@fdmalone
Copy link

fdmalone commented Jun 1, 2020

This also tripped me up.

@DmitryLyakh
Copy link

Had the same problem, had to resort to reinterpret_cast to be able to call HIP BLAS API with HIP complex numbers on HIP nvcc platform.

@leekillough
Copy link
Contributor

Fixed in #139

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants