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
(double*) instead of (void*) for complex numbers in CBLAS #1322
Comments
These are probably "historic" differences, already present in K.Goto's GotoBLAS from about 10 years ago. |
ATLAS and GSL CBLAS also uses It is clearly a problem if OpenBLAS does not provide the same API as the other CBLAS implementations. |
Netlib has this: |
@brada4 No, everybody except OpenBLAS has |
|
@brada4 This is precisely what we used to do in Debian. But I recently changed it to use the implementation-specific version of the |
Your change is correct. All that appears to be cblas can use reference header. |
For |
@martin-frbg what do you think about making openblas.h that includes netlib cblas.h on top of own special macros/functions, but otherwise stop breaking peoples' expectations? |
Not sure where a special openblas.h would come in, at least at the moment I am more inclined to change the problematic declarations in cblas.h and leave everything else in the headers as it currently is. |
maybe rectify out specific functions, then append reference header? |
@claudius-hubig @sebastien-villemot I wonder if one of you could review (or at least compile-test) my PR #1347 before I let it loose onto the world ? Given how widespread the changes resulting from the requested change of the header were, I'd hate to have to self-approve it. |
@martin-frbg I can only comment on the changes in At least in I can’t really comment on the changes in the other files, as I don’t understand them, however, they seem to be straightforward casts to fit with the lower levels of OpenBLAS? In any case, thank you for the effort you put into maintaining this huge project! |
Good catch on the overlooked parameter, I will update the PR accordingly. Being late to the project has its advantages, but the potential for causing huge code breakage is definitely not one of them. :-) |
(copy of Debian bug 877883 )
Dear Maintainer,
OpenBLAS in version 0.2.19-3 currently installed on Debian Stretch as well as the version 0.2.20+ds-4 in Testing declares the
cblas_*()
as takingdouble*
instead ofvoid*
for complex values. As an example, it declares cblas_zdscal asvoid cblas_zdscal(OPENBLAS_CONST blasint N, OPENBLAS_CONST double alpha, double *X, OPENBLAS_CONST blasint incX);
This function takes an array of complex numbers X and scales them by the real value alpha.
In contrast to this, all other packages in Debian as well as the Intel MKL define
cblas_zdscal
as taking avoid*
for X, i.e.:void cblas_zdscal(const int N, const double alpha, void *X, const int incX);
See e.g. Debian Codesearch or the MKL reference or the Netlib cblas.h.
The same difference applies to the cblas_zscal() function and all others:
I have only noticed the issue now as cblas.h has become part of the alternatives system and is currently directing to the OpenBLAS version in testing. In Stretch, if also libblas-dev is installed, its cblas.h is used and the difference hence hidden away.
I suspect that this problem is not more widespread because people tend to cast their arguments to
(void*)
explicitly, but the conversionstd::complex<double>* => void* => double*
is probably actually undefined…There was also some discussion in 2013, but it seemed to go nowhere.
I would be very thankful if there was some way to avoid the explicit casts to (void*) in calls specifically for OpenBLAS.
The text was updated successfully, but these errors were encountered: