Skip to content

bug in clblasiCamax??? #345

@B0L0666

Description

@B0L0666

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions