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

bug in clblasiCamax??? #345

Open
B0L0666 opened this issue May 5, 2019 · 0 comments
Open

bug in clblasiCamax??? #345

B0L0666 opened this issue May 5, 2019 · 0 comments

Comments

@B0L0666
Copy link

B0L0666 commented May 5, 2019

According to documentation clblasiCamax finds

"index of max absolute value in a complex float array"

As I understand this "absolute value" for acomplex arrays is a magnitude. Am I right?
To be clear, if z = a + ib is a complex number then absolute value of z (its magnitude) can be computed as |z| = sqrt(a^2+b^2)
Meybe I'am doing something wrong, but it seems that clblasiCamax subroutine finds the element with maximum sum of absolute values of real and imaginary part which obviously is not the same as the magnitude value (it comes form Cauchy–Schwarz inequality |x+y| <= |x| + |y|). In result we get wrong maximum indices for single precision complex arrays. I don't know if there is a similar issue with other complex versions of this subroutine or meybe documentation uses different definition of the absolute value of the complex number or meybe I'am doing something wrong? For testing I used sligthly modified version of the example program:

clBlas.zip

and the latest pre-compiled releases (2.12.00 Windows x64)
https://github.com/clMathLibraries/clBLAS/releases

@B0L0666 B0L0666 changed the title bug in clblasiCamax bug in clblasiCamax??? May 5, 2019
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

1 participant