Skip to content

syrk C API function is called with incorrect arguments ? #16

@snd

Description

@snd

i think there is a small bug in the syrk implementation.

code in question:

a.rows(), a.cols(),

you are passing a.rows() as argument 4 whereas the blas documentation specifies argument 4 as the order of c. the order of c is c.rows() or alternatively c.cols() since c.rows() == c.cols().

N Order of matrix C.

you are passing a.cols() as argument 5 whereas the blas documentation specifies argument 5 as (translated to rust in the context of that function):

match trans {
  Transpose::NoTrans => a.cols(),
  Transpose::Trans => a.rows(),
  Transpose::ConjTrans => a.rows(),
}

Number of columns in matrix A (or number of rows if matrix A is transposed).

On entry with TRANS = 'N' or 'n', K specifies the number of columns of the matrix A, and on entry with TRANS = 'T' or 't' or 'C' or 'c', K specifies the number of rows of the matrix A. K must be at least zero.

sources:
https://developer.apple.com/library/mac/documentation/Accelerate/Reference/BLAS_Ref/index.html#//apple_ref/c/func/cblas_ssyrk
http://www.netlib.org/lapack/explore-html/db/dc9/group__single__blas__level3.html#gae953a93420ca237670f5c67bbde9d9ff
https://software.intel.com/en-us/node/468490

this bug prevents me from using syrk in any meaningful way: i always get an error from blas.

i'd be happy to fix this, write tests and do a PR.

let me know.

i'd also go over the other implementations (syr2k, etc) and audit the arguments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions