What are the extra arguments of some BLAS functions?

Some BLAS functions called from the Julia standard library are passed
extra arguments. For instance:

    ccall((@blasfunc(dtrsm_), libblastrampoline), Cvoid,
        (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{UInt8},
            Ref{BlasInt}, Ref{BlasInt}, Ref{FT}, Ptr{FT},
            Ref{BlasInt}, Ptr{FT}, Ref{BlasInt},
            Clong, Clong, Clong, Clong),
        side, uplo, transa, diag,
        m, n, alpha, A, lda, B, ldb,
        1, 1, 1, 1)

The four Clong, in this example… Does anyone know what that is about?

I assume you’re referring to these lines. git blame says that they were added by Adjust calling convention of LAPACK functions by vchuravy · Pull Request #38836 · JuliaLang/julia · GitHub — the explanation is that they are “hidden” arguments corresponding to the lengths of the four character arguments (side, uplo, transa, and diag), as required by the Fortran ABI.

1 Like